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 » Scripting Helpers
Home Search
 

Re: Having another problem with my leaderboard

Previous Thread :: Next Thread 
Dodeca is not online. 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
Brickman2010 is not online. Brickman2010
Joined: 20 Nov 2009
Total Posts: 5547
16 May 2014 12:10 AM
Make sure you are using this online, not in PLAY SOLO mode.
Report Abuse
nacker is not online. 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 is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
16 May 2014 12:57 AM
DATAPERSISTANCE DOESNT WORK IN TEST MODE
Report Abuse
Dodeca is not online. Dodeca
Joined: 11 Sep 2011
Total Posts: 13649
16 May 2014 08:41 AM
Ok, thanks guys!
Report Abuse
Dodeca is not online. 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 is not online. 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 is not online. Dodeca
Joined: 11 Sep 2011
Total Posts: 13649
16 May 2014 09:08 AM
Ok, thanks.
Report Abuse
wazap is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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