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

How do I Load and Save strings in Data Persistence?

Asked by 9 years ago

Im trying to save people's nicknames in a game i am developing. Please help.

1 answer

Log in to vote
3
Answered by
bbissell 346 Moderation Voter
9 years ago

Data Persistence can easily be called from the Player itself (Unlike Data Store where you have to call the service). Also remember that you should make a habit of using :WaitForDataReady(). This is very important to keep errors out of your script. Here are some examples:

game.Players.bbissell:WaitForDataReady() --Waits for the Data Persistence Service to be available.
game.Players.bbissell:SaveString("Nickname", "myNickname") --Saves the string to that player
print(game.Players.bbissell:LoadString("Nickname")) --Prints the saved string for that player

There is much more you can do with the Data Persistence service. Read up on it here.

0
Thanks! :D duckhunter392 25 — 9y
Ad

Answer this question