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 |
|
|
|
| 30 Aug 2011 11:33 AM |
1. With a script. 2. PlayerAdded/PlayerRemoved 3. Yes. |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 01 Sep 2011 06:34 PM |
| Question 1 answer: not what I meant. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 01 Sep 2011 07:06 PM |
http://wiki.roblox.com/index.php/Data_Persistence_Complete_Guide
~ Mitch |
|
|
| Report Abuse |
|
|