Use stronger reference to CharacterAssets.
This should stop some server errors where these scripts were starting before the CharacterAssets folder was parented correctly.
This commit is contained in:
parent
5fd0da89a9
commit
1333f4c427
|
|
@ -25,6 +25,8 @@ local requestCharacter = Instance.new("RemoteEvent")
|
||||||
requestCharacter.Name = "RequestCharacter"
|
requestCharacter.Name = "RequestCharacter"
|
||||||
requestCharacter.Parent = ReplicatedStorage
|
requestCharacter.Parent = ReplicatedStorage
|
||||||
|
|
||||||
|
local assets = ServerStorage:WaitForChild("CharacterAssets")
|
||||||
|
|
||||||
local hats = Instance.new("Folder")
|
local hats = Instance.new("Folder")
|
||||||
hats.Name = "ServerHatCache"
|
hats.Name = "ServerHatCache"
|
||||||
hats.Parent = ServerStorage
|
hats.Parent = ServerStorage
|
||||||
|
|
@ -54,7 +56,6 @@ local function safeDestroy(obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onCharacterAdded(char)
|
local function onCharacterAdded(char)
|
||||||
local assets = ServerStorage.CharacterAssets
|
|
||||||
local player = Players:GetPlayerFromCharacter(char)
|
local player = Players:GetPlayerFromCharacter(char)
|
||||||
|
|
||||||
local bodyColors = assets.BodyColors:Clone()
|
local bodyColors = assets.BodyColors:Clone()
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ local function applyCharacter(humanoid)
|
||||||
local model = humanoid.Parent
|
local model = humanoid.Parent
|
||||||
|
|
||||||
if not CollectionService:HasTag(humanoid, "Classified") then
|
if not CollectionService:HasTag(humanoid, "Classified") then
|
||||||
local characterAssets = ServerStorage.CharacterAssets
|
local characterAssets = ServerStorage:WaitForChild("CharacterAssets")
|
||||||
CollectionService:AddTag(humanoid, "Classified")
|
CollectionService:AddTag(humanoid, "Classified")
|
||||||
|
|
||||||
for _,v in pairs(model:GetDescendants()) do
|
for _,v in pairs(model:GetDescendants()) do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue