So I'm trying to make a script that saves a players points when they leave. I basically wants the points to get updated everytime they leave by using PlayerRemoving. So i was wondering if PlayerRemoving is good? or is it any better options?
ty!
So I'm trying to make a script that saves a players points when they leave. I basically wants the points to get updated everytime they leave by using PlayerRemoving. So i was wondering if PlayerRemoving is good? or is it any better options?
ty!
YESSS!. Whenever your handling datastores its best to use them everytime they enter and leave your game. Using playeradded is good for when a player is joining your game so you can load heir data, and playerremoving is great for saving data as they leave your game.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
However if the player is leaving the game, it is recommended you add the game.OnClose = function() wait(30) end to make sure that last player leaving, gets their Data saved. Otherwise the YieldFunction may take too long and the server would shutdown during the saving process.
^^ What he said.