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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 06 Sep 2015 01:27 PM |
@MK
Dang I messed up
Sorry man,
DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerVisits") |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 01:28 PM |
https://www.youtube.com/watch?v=VXcbZ2kurvk
I am special because I have a siggy (👌 ͡° ͜ʖ ͡°👏) |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 06 Sep 2015 02:50 PM |
*Async
When the beat drops I'm like: ( ͡° ͜ʖ ͡°) ( ͡⊙ ͜ʖ ͡⊙) ( ͡◉ ͜ʖ ͡◉) |
|
|
| Report Abuse |
|
|
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 |
|
|