The HumanoidDescription is just not being applied for some reason, however if I set exact values it does.
Players.CharacterAutoLoads = false
Players.PlayerAdded:Connect(function(Player)
local Data = Info:GetData(Player)
local Race, Deviation = Data["RACE"], Data["DEVIATION"]
local HumanoidDescription = Info:GetDescription(Race, Deviation)
print(HumanoidDescription.HeadColor)
Player:LoadCharacterWithHumanoidDescription(HumanoidDescription)
Player.Character.Humanoid:ApplyDescription(HumanoidDescription)
script.Server:Fire(Player) -- Change Animations
Stats:sendData(Player)
Inventory:sendData(Player)
end)
local Races = {
["Race1"] = {
HeadColor = 220;
TorsoColor = 220;
RightArmColor = 220;
LeftArmColor = 220;
RightLegColor = 220;
LeftLegColor = 220;
};
["Race2"] = {
HeadColor = 30;
TorsoColor = 30;
RightArmColor = 30;
LeftArmColor = 30;
RightLegColor = 30;
LeftLegColor = 30;
};
}
function Info:GetData(Player)
return DataStore2("Info", Player):GetTable(DEFAULT)
end
function Info:GetDescription(Race, Deviation)
local Description = Races[Race]
local HumanoidDescription = Instance.new("HumanoidDescription")
for Property, Value in pairs(Description) do
HumanoidDescription[Property] = Color3.fromRGB(Value + Deviation, Value + Deviation, Value + Deviation)
end
return HumanoidDescription
end
The problem seems to be with the line Info:GetData(Player) , since if I add a wait(10) after it works, but I don’t want to add an crazy wait() just to get this to work.
So how can I fix this delay(?) issue
