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:
CloneTrooper1019 2019-11-10 03:15:13 -06:00
parent 5fd0da89a9
commit 1333f4c427
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,8 @@ local requestCharacter = Instance.new("RemoteEvent")
requestCharacter.Name = "RequestCharacter"
requestCharacter.Parent = ReplicatedStorage
local assets = ServerStorage:WaitForChild("CharacterAssets")
local hats = Instance.new("Folder")
hats.Name = "ServerHatCache"
hats.Parent = ServerStorage
@ -54,7 +56,6 @@ local function safeDestroy(obj)
end
local function onCharacterAdded(char)
local assets = ServerStorage.CharacterAssets
local player = Players:GetPlayerFromCharacter(char)
local bodyColors = assets.BodyColors:Clone()

View File

@ -205,7 +205,7 @@ local function applyCharacter(humanoid)
local model = humanoid.Parent
if not CollectionService:HasTag(humanoid, "Classified") then
local characterAssets = ServerStorage.CharacterAssets
local characterAssets = ServerStorage:WaitForChild("CharacterAssets")
CollectionService:AddTag(humanoid, "Classified")
for _,v in pairs(model:GetDescendants()) do