MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
|
| 09 Nov 2016 11:32 AM |
I don't get any errors in studio, in the actual ROBLOX place it says "World is not a valid member of leaderstats", but in studio, when I view the players leaderstats it's there? Anyone get this before?
local ds = ga################################################################s2 = ga#########################################################local ds3 = ga############################################################################################################## local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local world = Instance.new("IntValue", stats) world.Name = "World" local stage = Instance.new("IntValue", stats) stage.Name = "Stage" local coins = Instance.new("IntValue", stats) coins.Name = "Coins" end)
wait(1) --To insure that everything works before it tries to set stats
game.Players.PlayerAdded:connect(function(plr) --KEYS local key = "User_"..plr.UserId local key2 = "User1_"..plr.UserId local key3 = "User2_"..plr.UserId --KEYS --OLD STATS local oldWorld = ds:GetAsync(key) local oldStage = ds2:GetAsync(key2) local oldCoins = ds3:GetAsync(key3) --OLD STATS --LOAD STATS if oldWorld then plr.leaderstats.World = oldWorld else plr.leaderstats.World = 1 end if oldStage then plr.leaderstats.Stage = oldStage else plr.leaderstats.Stage = 1 end if oldCoins then plr.leaderstats.Coins = oldCoins else plr.leaderstats.Coins = 0 end --LOAD STATS end)
|
|
|
| Report Abuse |
|
|
MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
|
| 09 Nov 2016 11:38 AM |
| ############################################################################################# |
|
|
| Report Abuse |
|
|
MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
|
| 09 Nov 2016 11:41 AM |
ROBLOX has really done this time with the #ing. Especially if I'm only posting code with functions that they endorse on their wiki and website.
|
|
|
| Report Abuse |
|
|
MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
| |
|
Briicks
|
  |
| Joined: 03 Apr 2015 |
| Total Posts: 1796 |
|
|
| 09 Nov 2016 11:55 AM |
Don't use multi keys, use a table, and set all your values in the table... Also not 100% but from doing it the other day, don't add that wait before playeradded event, maybe inside it.
If you cant do the tables, make it a model and post link and i'll make it a table for you.
Instant Profit Finder: https://www.roblox.com/games/486614503/SFPF |
|
|
| Report Abuse |
|
|
MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
|
| 09 Nov 2016 11:59 AM |
The wait didn't work, here's the model: https://www.roblox.com/item.aspx?id=541287481
|
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 12:34 PM |
| Making data store are really hard, because they never function |
|
|
| Report Abuse |
|
|
MezornoIV
|
  |
| Joined: 20 Jul 2010 |
| Total Posts: 2276 |
|
| |
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 09 Nov 2016 12:48 PM |
You should take this and see how it works, it might help. :)
https://www.roblox.com/library/438429848/DataStore-Leaderstats |
|
|
| Report Abuse |
|
|