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 » Scripters
Home Search
 

Leaderboards

Previous Thread :: Next Thread 
Lentex is not online. Lentex
Joined: 24 Jun 2011
Total Posts: 520
06 Sep 2015 01:08 PM
Is there a leader board that saves? For example, if I change someones money value to 50, how will I make it stay 50 even in a new server?

pointless siggy is pointless
Report Abuse
Tanker273Backup is not online. Tanker273Backup
Joined: 17 Aug 2012
Total Posts: 56
06 Sep 2015 01:21 PM
Using DataStore would be your easiest solution, but sadly I haven't even figured it out fully yet :(
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
06 Sep 2015 01:26 PM
DataStore = DataStore = game:GetService("DataStoreService"):GetDataStore("Score")

for _, v in next,(game["Players"]:GetPlayers()) do

local Value = DataStore:SetAsnc("user_",,v.userId,v:WaitForChild("leaderstats").Score.Value)

end
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
06 Sep 2015 01:27 PM
^Async*
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
06 Sep 2015 01:27 PM
http://wiki.roblox.com/index.php?title=Data_store

@tanker

if it helps at all, try to think of a DataStore itself as a large table (better yet, a dictionary). the DataStore holds keys and values. each value belongs to each unique key. (if you're saving player data, the keys would be something like this: "player_"..player.userId. so then each player gets a unique key to save their player data to.)

http://wiki.roblox.com/images/2/23/DataStore_Example.png


Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
06 Sep 2015 01:27 PM
@MK

Dang I messed up

Sorry man,


DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerVisits")
Report Abuse
johnjohncar is not online. johnjohncar
Joined: 22 Aug 2012
Total Posts: 3557
06 Sep 2015 01:28 PM
https://www.youtube.com/watch?v=VXcbZ2kurvk



I am special because I have a siggy (👌 ͡° ͜ʖ ͡°👏)
Report Abuse
Tanker273Backup is not online. Tanker273Backup
Joined: 17 Aug 2012
Total Posts: 56
06 Sep 2015 01:43 PM
I know how DataStores theoretically work and everything, just all my attempts at setting up a functional one for cross-gameplay data saving has been a failure, is what I meant, but thanks for the explanation!
Report Abuse
Lentex is not online. Lentex
Joined: 24 Jun 2011
Total Posts: 520
06 Sep 2015 02:10 PM
So, I just put that in a script?


pointless siggy is pointless
Report Abuse
MKofOrbiter is not online. MKofOrbiter
Joined: 28 Aug 2010
Total Posts: 910
06 Sep 2015 02:26 PM
-- Now I am getting pissed off at myself for typing fast. :/ o. o


DataStore = game:GetService("DataStoreService"):GetDataStore("Score")

for _, v in next,(game["Players"]:GetPlayers()) do

local Value =
DataStore:SetAsnc("user_"..v.userId,v:WaitForChild("leaderstats").Score.Value)
end

-- I swear if there is anymore mistakes I think I may rage.
Report Abuse
AdvancedDrone is not online. AdvancedDrone
Joined: 17 Apr 2010
Total Posts: 2599
06 Sep 2015 02:50 PM
*Async



When the beat drops I'm like: ( ͡° ͜ʖ ͡°) ( ͡⊙ ͜ʖ ͡⊙) ( ͡◉ ͜ʖ ͡◉)
Report Abuse
imalex4 is not online. imalex4
Joined: 16 Aug 2012
Total Posts: 48
06 Sep 2015 03:49 PM
You just have to know what you're doing to players don't lose data. Read this:

http://wiki.roblox.com/index.php?title=Data_store
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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