A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeFAQRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
 
naknak
 
Supernapalm
 
m27frogy
 
slayer9365
 
myrco919
 
branefreez
 
ninga95
 
CloneTrooper787
 
raboy117
 
Top posting users this month
Latest topics
» Send me an Email
January 8th 2016, 10:14 am by naknak

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
July 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
July 6th 2015, 4:16 pm by m27frogy

» Ambassador!
April 15th 2015, 11:40 pm by naknak

» Boop - Tag
April 13th 2015, 9:46 pm by naknak

» Vip Class Script
April 13th 2015, 4:54 pm by naknak

» Who's active?!
April 13th 2015, 4:52 pm by naknak

» Where to go from here.
April 13th 2015, 4:51 pm by naknak

» Genesis Point
July 17th 2014, 7:04 pm by branefreez

» Reward System
July 17th 2014, 5:41 am by m27frogy

» Script Request
July 10th 2014, 11:43 am by naknak

» local scripts?
July 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
July 10th 2014, 11:36 am by naknak

» Hi. I am new here
April 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
January 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
January 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
January 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
November 26th 2013, 3:33 pm by Keanu73

» Improve Coding
October 26th 2013, 1:12 pm by pook03

» Simple Button
September 1st 2013, 6:19 pm by branefreez


Share | 
 

 Data Persistence Tutorial [ Numbers Saving ]

Go down 

Was this tutorial helpful?
Yes
50%
 50% [ 2 ]
No
0%
 0% [ 0 ]
Could have been better
50%
 50% [ 2 ]
Total Votes : 4
 

AuthorMessage
Guest
Guest



PostSubject: Data Persistence Tutorial [ Numbers Saving ]   June 4th 2011, 3:15 pm

I created a tutorial on the main ROBLOX Website. I will be going through all of the need to know stuff in here.

First thing is Saving. You cant save progress unless a players Data has been loaded. There is a method to wait until the players Data is loaded. Although we have to start off with a more Basic line. This line is what triggers the function. Here us a Function which will trigger when a player leaves the game.

game.Players.PlayerRemoving:connect(function(player)

Now we must incorporate the line to wait until the players Data is ready

player:WaitForDataReady()

The next line is what you would like to save. In here we will be saving a players KOs value.

player:SaveNumber("KOs", player.leaderstats.KOs.Value)

Now as with all functions we need an end

end)

Here is the complete script:

game.Players.PlayerRemoving:connect(function(player)
player:WaitForDataReady()
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
end)

The main line is line 3. Inside the brackets are arguments. The first argument is what you will save the Number as. The second argument is the value you are saving. In this case we are saving the value of Knock outs inside the leaderstats inside the player.

Please vote on the poll, I will use the results to improve future Tutorials
Back to top Go down
myrco919
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 190
Join date : 2011-01-21
Age : 20
Location : Holland

PostSubject: Re: Data Persistence Tutorial [ Numbers Saving ]   June 27th 2011, 10:37 am

Could have been a little better, like also explaining the loading part and the sorts you can save/load. I.E Boolean/Number/String etc
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 19

PostSubject: Re: Data Persistence Tutorial [ Numbers Saving ]   November 20th 2011, 6:17 am

well explained! =D

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
Sponsored content




PostSubject: Re: Data Persistence Tutorial [ Numbers Saving ]   

Back to top Go down
 
Data Persistence Tutorial [ Numbers Saving ]
Back to top 
Page 1 of 1
 Similar topics
-
» Odd numbers
» Curl Tutorial!
» Stuck on getting data centers?
» AOE_Fan's RMS Command Tutorial
» how to get map data back from maps already published yours and others

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Tutorials and Resources :: Intermediate-
Jump to: