Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

In a datastore if the person crashes does it count as player.Removing?

Asked by 5 years ago

Because people have been telling me to only use player added and player removing game:BindToclose()

But im scared that if a player plays a game for 5 hours and he crashes the data might all be gone

0
It should. The player is still being removed. But just in case you could also implement an autosave feature, maybe every 10 minutes save all players data. But i wouldn't call it neccesary. DinozCreates 1070 — 5y
0
If the client isn't responding to the server for an extended period of time, the game will eventually disconnect the player and count that instant as the player leaving the game. So yes, this will still invoke PlayerRemoving. ScriptGuider 5640 — 5y

1 answer

Log in to vote
1
Answered by
BenSBk 781 Moderation Voter
5 years ago
Edited 5 years ago

Yes; Players.PlayerRemoving will always be fired, no matter how the player leaves. DataModel:BindToClose has a completely different use—preventing the place instance from closing until all player data has been saved.

0
PlayerRemoving does not fire on shutdown so you need to use BindToClose to save player data User#5423 17 — 5y
0
It does fire BenSBk 781 — 5y
Ad

Answer this question