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: Help.

Previous Thread :: Next Thread 
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
30 Jul 2013 12:57 PM
The value doesn't get saved when a player leaves, how can I make that work?

game.Players.PlayerRemoving:connect(function(player)
player:WaitForDataReady()
player:SaveNumber("Stage", player.leaderstats.Stage.Value)
print(""..player.Name.."'s Value ("..player.leaderstats.Stage.Value..") Saved")
end)
Report Abuse
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
30 Jul 2013 01:16 PM
Come on people. I'm here to be helped.
Report Abuse
clc02 is not online. clc02
Joined: 30 Dec 2007
Total Posts: 7393
30 Jul 2013 01:20 PM
game.Players.PlayerRemoving:connect(function(player)
if player.DataReady then
player:SaveNumber("Number", 5)
end
end)

First off, you didn't even wait till you were off the first page before you start complaining. It's not like it's an hour wait. I found that on the wiki in ten seconds, make yours like that and see if it works.
Report Abuse
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
30 Jul 2013 01:24 PM
This is how it is, doesn't saves.

game.Players.PlayerRemoving:connect(function(player)
player:WaitForDataReady()
player:SaveNumber("Stage", player.leaderstats.Stage.Value)
print(""..player.Name.."'s Value ("..player.leaderstats.Stage.Value..") Saved")
end)

PS. I already have posted this 5 hours ago or something like that...
Report Abuse
SpleenYanks is not online. SpleenYanks
Joined: 24 Aug 2008
Total Posts: 921
30 Jul 2013 01:26 PM
I have a suspicion that it is the
player:WaitForDataReady()
that is making it not save.
Report Abuse
clc02 is not online. clc02
Joined: 30 Dec 2007
Total Posts: 7393
30 Jul 2013 01:28 PM
I just told you want to change it to. As much as I like hand holding new scripters you should be able to change a word and a number to what you want from the script that works.
Report Abuse
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
30 Jul 2013 01:29 PM
Alright. Thank you. Still doesn't save. Maybe it's something with my Touch System that makes it fail?

local sp = script.Parent
local Stage = 1

sp.Touched:connect(function(hit)
local player = game.Players:findFirstChild(hit.Parent.Name)
local P_Stage = player.leaderstats.Stage

if player.leaderstats.Stage.Value == Stage - 1 then
player.leaderstats.Stage.Value = Stage
end
end)
Report Abuse
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
30 Jul 2013 01:32 PM
Maybe it's hard to read for you?

player:SaveNumber("Stage", player.leaderstats.Stage.Value)
Posted it already 2 times......
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