generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Data persistence questions

Previous Thread :: Next Thread 
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
30 Aug 2011 11:08 AM
1. How do I use DP

2. What event of the player should I use

3. Do I have to save all files individually?
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
30 Aug 2011 11:33 AM
1. With a script.
2. PlayerAdded/PlayerRemoved
3. Yes.
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
01 Sep 2011 06:34 PM
Question 1 answer: not what I meant.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
01 Sep 2011 07:03 PM
Here's the tutorial.

Note: ALL of these functions are in the Player Object.

SaveBool(key, value)
SaveNumber(key, value)
SaveString(key, value)
SaveInstance(key, value)

LoadBool(key)
LoadNumber(key)
LoadString(key)
LoadInstance(key)

Each save/load function will do exactly what you would think, save/load the datatype they hold.

There's a max limit:

Bools and numbers take 1 unit.
Strings take their length divided by 100 (rounded up)
Instances take their .DataCost property.

The limit is 45000 DP units, but may be raised later. DO NOT BREAK THIS LIMIT, bad things happen.

Examples:

player:SaveBool("Example", true)
print(player:LoadBool("Example"))
>true

It is (or was, this may have changed) good practice to run all DP functions in protected mode with pcall() or xpcall() or coroutines, as they occasionally fail.
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
01 Sep 2011 07:06 PM
http://wiki.roblox.com/index.php/Data_Persistence_Complete_Guide

~ Mitch
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image