Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 21 Feb 2016 08:53 AM |
My script structure
PlayerAdded GetAsync load
PlayerRemoving SetAsync save
while wait(180) do --3 minutes SetAsync save each player end |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 21 Feb 2016 10:51 AM |
| Why is there some data loss? |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 10:52 AM |
Pay Attention to what comes on my other thread "game.OnClose = function()" That is what you need to use.
#code if Developer == true then print('Developer') end |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
|
| 21 Feb 2016 01:39 PM |
take out the while loop, idiot.... a player will leave your game regardless so why the loop...
#code R+ | local RAP = "R$424,519"; local robux = "R$8,977" |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 01:42 PM |
"take out the while loop, idiot.... a player will leave your game regardless so why the loop..."
calling someone an idiot is very rude
#Code print("Narwhals are our future") |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 01:52 PM |
"take out the while loop, idiot.... a player will leave your game regardless so why the loop..."
R00D
He is probably new to datastores...
|
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 21 Feb 2016 02:00 PM |
'take out the while loop, idiot.... a player will leave your game regardless so why the loop...'
oh please, just lol
i am following this: http://wiki.roblox.com/index.php?title=Saving_Player_Data
The reason with the while loop is what if the player disconnects? I don't think it triggers the playerremoving event... |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 21 Feb 2016 02:01 PM |
| also why tf do i have u on my friend list lmao |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
| |
|
|
| 21 Feb 2016 02:21 PM |
Players disconnecting will fire the playerLeaving event.
playerLeaving is basically just
game.Players.ChildRemoving:connect(function(child) if (child:isA("Player")) then --[[Do things.]] end end) |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 02:22 PM |
here are some tips
you can entierly rely with player removing if you make sure that shutdowns can't mess up data using game.OnClose() which lets you save data before the game shuts down
your structure is fine otherwise
you most likely have an error in your code somewhere
#Code print("Narwhals are our future") |
|
|
| Report Abuse |
|
|