I am making a rpg game and I need to store player data whilst they are in the game. I have made a gui and used a variable to store integers but this gets reset when the player dies. where should I move the variable to so it is not lost when the player dies?
where is the best place to store player data whils they are in game?[Closed]
2 answers
The best place to store data inside the individual player file under Players.
You make a script that creates an IntValue inside the player. It is basically the same principle used in game leaderboards. Here is a link to a wiki on IntValues to help you out!
6 comments
Thanks for the help, I have made a leaderstats to hold the values but is there a way to hide or make the leaderstats invisable?
Just solved the problem, all you need is a leaderboard then all of the variables are saved even if they are at the same level as the leaderboard. This means that there will be no data shown in the leaderboard
Yep, don't forget to thumbs up if I helped!
:p im new lol
:) So am I
If I answered your question please click the up arrow and check the little circle next to it. Thanks!
Just use a data store, this protects from exploiters in the player, or create a model inside of workspace that looks like this:
Workspace PlayersStuff micke3212 values values configuration etc
Then just use the :SaveInstance() method to save this model before the player leaves.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Hey bro. Its me, remember you were helping me with the Car spawning GUI? Ive been waiting a while, and I really need help with that. Im new and you are my only hope :). I dont know how else to contact you, please accept my friend request. I learned more than I ever learned just by your help. Please continue! Thanks!