Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
|
| 15 May 2014 10:51 PM |
Was fine before, threw in data persistence.
local moneyvalue = "MoneyValue"
game.Players.PlayerAdded:connect(function(player) if player:WaitForDataReady() then local leaderstats = Instance.new("IntValue", player) leaderstats.Name = "leaderstats" local Money = Instance.new("IntValue", leaderstats) Money.Name = "Money" player.leaderstats.Money:LoadNumber(moneyvalue) end end)
game.Players.PlayerRemoving:connect(function(player) if player:FindFirstChild("leaderstats") then player:SaveNumber(moneyvalue, player.leaderstats.Money.Value) end end)
while wait(1) do for _, Player in pairs(game.Players:GetPlayers()) do if Player:FindFirstChild("leaderstats") then Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + 5 end end end
|
|
|
| Report Abuse |
|
|
|
| 16 May 2014 12:10 AM |
| Make sure you are using this online, not in PLAY SOLO mode. |
|
|
| Report Abuse |
|
|
nacker
|
  |
| Joined: 06 Oct 2009 |
| Total Posts: 6034 |
|
|
| 16 May 2014 12:56 AM |
output? and do what above said as well |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 16 May 2014 12:57 AM |
| DATAPERSISTANCE DOESNT WORK IN TEST MODE |
|
|
| Report Abuse |
|
|
Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
| |
|
Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
|
| 16 May 2014 08:47 AM |
But even if data persistence doesn't work in play solo, how come the leaderboard wouldn't come up? even if it's not able to work in play solo shouldn't the leaderboard still come up? |
|
|
| Report Abuse |
|
|
Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 16 May 2014 08:57 AM |
| No, because there's not PlayerAdded event in play solo. |
|
|
| Report Abuse |
|
|
Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 16 May 2014 11:04 AM |
| player:waitfordataready() will never be true in test mode |
|
|
| Report Abuse |
|
|