fixed crash
This commit is contained in:
parent
88f8f2150e
commit
e285867bb4
|
|
@ -143,9 +143,11 @@ function LoadCharacterNew(playerApp,newChar)
|
||||||
--authentic roblox style loading
|
--authentic roblox style loading
|
||||||
local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")}
|
local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")}
|
||||||
for _,newVal in pairs(playerApp:GetChildren()) do
|
for _,newVal in pairs(playerApp:GetChildren()) do
|
||||||
|
newWaitForChild(newVal,"CustomizationType")
|
||||||
local customtype = newVal:FindFirstChild("CustomizationType")
|
local customtype = newVal:FindFirstChild("CustomizationType")
|
||||||
if (customtype.Value == 1) then
|
if (customtype.Value == 1) then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
newWaitForChild(newVal,"ColorIndex")
|
||||||
local colorindex = newVal:FindFirstChild("ColorIndex")
|
local colorindex = newVal:FindFirstChild("ColorIndex")
|
||||||
charparts[colorindex.Value].BrickColor = newVal.Value
|
charparts[colorindex.Value].BrickColor = newVal.Value
|
||||||
end)
|
end)
|
||||||
|
|
@ -236,6 +238,7 @@ function LoadCharacterNew(playerApp,newChar)
|
||||||
local newPart = game.Workspace:InsertContent("rbxasset://../../../charcustom/bodies/"..newVal.MeshIndex.Value.."/"..newVal.Value)
|
local newPart = game.Workspace:InsertContent("rbxasset://../../../charcustom/bodies/"..newVal.MeshIndex.Value.."/"..newVal.Value)
|
||||||
if newPart[1] then
|
if newPart[1] then
|
||||||
if newPart[1].className == "SpecialMesh" then
|
if newPart[1].className == "SpecialMesh" then
|
||||||
|
newWaitForChild(newVal,"MeshIndex")
|
||||||
local meshindex = newVal:FindFirstChild("MeshIndex")
|
local meshindex = newVal:FindFirstChild("MeshIndex")
|
||||||
newPart[1].Parent = charparts[newVal.MeshIndex.Value]
|
newPart[1].Parent = charparts[newVal.MeshIndex.Value]
|
||||||
else
|
else
|
||||||
|
|
@ -252,9 +255,11 @@ function LoadCharacterNew3DView(playerApp,newChar)
|
||||||
--authentic roblox style loading
|
--authentic roblox style loading
|
||||||
local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")}
|
local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")}
|
||||||
for _,newVal in pairs(playerApp:GetChildren()) do
|
for _,newVal in pairs(playerApp:GetChildren()) do
|
||||||
|
newWaitForChild(newVal,"CustomizationType")
|
||||||
local customtype = newVal:FindFirstChild("CustomizationType")
|
local customtype = newVal:FindFirstChild("CustomizationType")
|
||||||
if (customtype.Value == 1) then
|
if (customtype.Value == 1) then
|
||||||
pcall(function()
|
pcall(function()
|
||||||
|
newWaitForChild(newVal,"ColorIndex")
|
||||||
local colorindex = newVal:FindFirstChild("ColorIndex")
|
local colorindex = newVal:FindFirstChild("ColorIndex")
|
||||||
charparts[colorindex.Value].BrickColor = newVal.Value
|
charparts[colorindex.Value].BrickColor = newVal.Value
|
||||||
end)
|
end)
|
||||||
|
|
@ -332,6 +337,7 @@ function LoadCharacterNew3DView(playerApp,newChar)
|
||||||
local newPart = game.Workspace:InsertContent("rbxasset://../../../charcustom/bodies/"..newVal.MeshIndex.Value.."/"..newVal.Value)
|
local newPart = game.Workspace:InsertContent("rbxasset://../../../charcustom/bodies/"..newVal.MeshIndex.Value.."/"..newVal.Value)
|
||||||
if newPart[1] then
|
if newPart[1] then
|
||||||
if newPart[1].className == "SpecialMesh" then
|
if newPart[1].className == "SpecialMesh" then
|
||||||
|
newWaitForChild(newVal,"MeshIndex")
|
||||||
local meshindex = newVal:FindFirstChild("MeshIndex")
|
local meshindex = newVal:FindFirstChild("MeshIndex")
|
||||||
newPart[1].Parent = charparts[newVal.MeshIndex.Value]
|
newPart[1].Parent = charparts[newVal.MeshIndex.Value]
|
||||||
else
|
else
|
||||||
|
|
@ -614,8 +620,7 @@ function CSServer(Port,PlayerLimit)
|
||||||
Player:LoadCharacter()
|
Player:LoadCharacter()
|
||||||
LoadCharacterNew(newWaitForChild(Player,"Appearance"),Player.Character)
|
LoadCharacterNew(newWaitForChild(Player,"Appearance"),Player.Character)
|
||||||
end
|
end
|
||||||
while true do
|
while true do wait()
|
||||||
wait(0.001)
|
|
||||||
if (Player.Character ~= nil) then
|
if (Player.Character ~= nil) then
|
||||||
if (Player.Character.Humanoid.Health == 0) then
|
if (Player.Character.Humanoid.Health == 0) then
|
||||||
wait(5)
|
wait(5)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue