Fandom

ROBLOX Wikia

Data persistence

12,752pages on
this wiki
Add New Page
Comments0 Share

Data persistence is a method for saving data from one game session to another. The data is saved on the player, and to the place, which means that you can't use the data between games and that the player that got saved data must be in a server for the server to be able to load the data.

A way to save data between games is to use badges, but it is really complicated and one-way based.

Data Persistence is functions in the Player object.

:WaitForDataReady() 
:LoadBoolean(String key) 
:LoadNumber(String key) 
:LoadString(String key) 
:LoadInstance(String key) 
:SaveBoolean(String key,Bool value) 
:SaveNumber(String key,Number value) 
:SaveString(String key,String value) 
:SaveInstance(String key,Object value)

 :WaitForDataReady()

Used to make sure all data is ready, use this before any other Data Persistence code!

 :Load[Type](String key)

:LoadBoolean(String key) 
:LoadNumber(String key) 
:LoadString(String key) 
:LoadInstance(String key)

Load data of the given type from the given key in the player.

 :Save[Type](String key,[Type] value)

:SaveBoolean(String key,Bool value) 
:SaveNumber(String key,Number value) 
:SaveString(String key,String value) 
:SaveInstance(String key,Object value)

Saves data of the given type to the given key in the player.

Restrictions

As said the saved data is tied to a game and a player. It might be a 45000 byte storage limit (it is suggested in the official wiki)

Trivia

This section is a trivia section. Please relocate any relevant information into other sections of the article.

  • Some people lost their data playing games that used Data Persistence between May 28 and May 29 of 2014. The lost data was never recovered.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.