|
| 19 Nov 2013 12:35 PM |
game.Players.PlayerAdded:connect(function(plr) plr:WaitForDataReady() if plr.Name == "yoshimaster240102" then game.Workspace.TXT.Value = plr:LoadString("LastSes") end end)
game.Players.PlayerRemoving:connect(function(plr) if plr.Name == "yoshimaster240102" then plr:SaveString("LastSes", game.Workspace.TXT.Value) end end)
This is in a normal script inside a frame inside a gui. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 12:38 PM |
| Also, I tested in a server not play solo. Still didn't work. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 19 Nov 2013 12:40 PM |
function DPwait(pl) while not pl.DataReady do wait() end end
game.Players.PlayerAdded:connect(function(plr) DPwait(plr) if plr.Name == "yoshimaster240102" then game.Workspace.TXT.Value = plr:LoadString("LastSes") end end)
game.Players.PlayerRemoving:connect(function(plr) if plr.Name == "yoshimaster240102" then plr:SaveString("LastSes", game.Workspace.TXT.Value) end end)
not sure if thats the problem, but WaitForDataReady is kinda buggy |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 12:41 PM |
Um, WaitForDataReady, has always worked for me, so that couldn't be the problem. Ill just make a save button and a load button, but thank you for your time.
--Thread Closed-- |
|
|
| Report Abuse |
|
|
Quorum
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4680 |
|
|
| 19 Nov 2013 12:45 PM |
@Yoshi, 1) I don't see why you're putting the script in a GUI when you could simply put it in Workspace (or use one of the new storage related services). You would also find that if you were the first person there, then the 'PlayerAdded' event wouldn't fire as you joined before the script ran. 2) I wouldn't advise using the 'PlayerRemoving' event with data persistence as there have been cases where the player's data hasn't saved correctly. |
|
|
| Report Abuse |
|
|