Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

where is the best place to store player data whils they are in game?[Closed]

Asked by 10 years ago

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?

0
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! BADABOO2016 3 — 6y

2 answers

Log in to vote
2
Answered by 10 years ago

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!

http://wiki.roblox.com/index.php?title=API:Class/IntValue

0
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? User#5423 17 — 10y
0
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 User#5423 17 — 10y
0
Yep, don't forget to thumbs up if I helped! Champion121212 22 — 10y
0
:p im new lol User#5423 17 — 10y
View all comments (2 more)
0
:) So am I Champion121212 22 — 10y
0
If I answered your question please click the up arrow and check the little circle next to it. Thanks! Champion121212 22 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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.

Answer this question