From 1333f4c42709cbe20f061560468f3f11c7d954b3 Mon Sep 17 00:00:00 2001 From: CloneTrooper1019 Date: Sun, 10 Nov 2019 03:15:13 -0600 Subject: [PATCH] Use stronger reference to CharacterAssets. This should stop some server errors where these scripts were starting before the CharacterAssets folder was parented correctly. --- Server/Scripts/Characters.server.lua | 3 ++- Server/Scripts/Parts.server.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Server/Scripts/Characters.server.lua b/Server/Scripts/Characters.server.lua index e0ac689..4a3d69b 100644 --- a/Server/Scripts/Characters.server.lua +++ b/Server/Scripts/Characters.server.lua @@ -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() diff --git a/Server/Scripts/Parts.server.lua b/Server/Scripts/Parts.server.lua index dbfd2be..6b5ce7a 100644 --- a/Server/Scripts/Parts.server.lua +++ b/Server/Scripts/Parts.server.lua @@ -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