Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

2 comments

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.

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.

1 answer

✓ Accepted answer

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.

2 comments

0

PlayerRemoving does not fire on shutdown so you need to use BindToClose to save player data

0

It does fire

This discussion is preserved as it was. New answers, comments, and votes are closed.