|
| 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 |
|
|
|
| 30 Jul 2013 01:16 PM |
| Come on people. I'm here to be helped. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|