Why doesn't character added work when the character is fully added? i dont get this, and its really messing up my custom character datastore save between games.
I found a fix, was to wait five seconds, then change character values. But if i dont have that, it sometimes doesn't work at all and ignores my other code in it.
Here is my code.
local PlrsFolders = game.ReplicatedStorage:WaitForChild("Profiles")
local selectface = game.ReplicatedStorage.Database.Items.Faces
local newhairboy = game.ReplicatedStorage.Database.Items.Hair.Hair.Boys
local newhairgirl = game.ReplicatedStorage.Database.Items.Hair.Hair.Girls
game:GetService("Players").PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(5)
if PlrsFolders[p.UserId].Char_Info.Bodyclr.Value == 1 then
char["Body Colors"].TorsoColor = BrickColor.new("Pastel brown")
char["Body Colors"].HeadColor = BrickColor.new("Pastel brown")
char["Body Colors"].RightArmColor = BrickColor.new("Pastel brown")
char["Body Colors"].LeftArmColor = BrickColor.new("Pastel brown")
char["Body Colors"].RightLegColor = BrickColor.new("Pastel brown")
char["Body Colors"].LeftLegColor = BrickColor.new("Pastel brown")
end
end)
end)
It changes body color for different "Bodyclr" values.
Why does this work, but if i remove wait(5)
it wont?
How can i make sure the character loads in, what if it takes more than five seconds? and it doesn't load at all? what do i do to make it accurate?
Thank you.

3 comments
CharacterAdded must be from the server. Hope this helps!
Thank you, this script is a server script in serverscriptservice.
Do wait() instead of wait(5)