Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

DataStore saving appearance help?

https://pastebin.com/raw/rwcjxddL

I am trying to make a datastore which saves/loads shirts and pants when you join or leave the game. The problem Is that Player.Character returns nil and at line 18 Saved Clothes is nil. Help?

2 answers

I fix this by using

repeat wait() until Player.Character

Try putting that in before loading the shirts and stuff

Same idea as roy6576's answer, but without a repeat until loop.

local character = player.Character or player.CharacterAdded:Wait()

When the player joins, the character isn't instantly loaded. The code above will be set to player.Character if it exists, else it will wait for it to exist and then set it to player.Character.

This discussion is preserved as it was. New answers, comments, and votes are closed.