So i have a game where you spawn with a custom avatar and you can click stuff to spend money to wear clothing, but when you die, you lose your clothing and have to buy it again. Can someone give me tips or answer on how to save the content of an avatar's clothing?
BoolValue
for when a player joins and put it inside the Player
object.When they buy the clothing, set the Value
of the BoolValue
to true
, and check if it is true to save the clothing. Another tip I have is to save the ShirtTemplate
and PantsTemplate
, and give the clothing back with their clothing.!If you're trying to save it when the player leaves the game, use datastore. If you're trying to remove cloths on death, but not save if they leave the game, use Character Added to detect when the player respawns. Then clear their clothing. Save the clothing IDs in a table (recommended) of the cloths for both shirts and pants (separate). Clear that table when they die with the Character Added. Add the cloths they purchase.
If you're not using datastore, ignore the datastore part.
I reccomend you insert BoolValues for each clothing item that states if the own them. You can use a datastore script to save if they own or not own the clothing, so they dont have to buy it again. And then you can jsut load it manually or automatically when they join the game.