Is it better to save Data by PlayerRemoving or BindToClose?

Which way is better to save data?

Should i use plr.PlayerRemoving or game:BindToClose()?

They both appear to save the data.

1 Like

If I were you, I would use both, as a security measure. But in my opinion, plr.PlayerRemoving is a bit better since it saves the players data when they leave, rather than saving their data when the server shuts down.

Edit: BindToClose is a event that runs only when the server is about to shut down. My bad!

4 Likes

BindToClose only fires when the server is about to close, like @furious_cucomber said, i’d use both as a security measure

1 Like

When the last player leaves I believe the game’s too slow to save using PlayerRemoving. It works fine when the server is still up, but BindToClose is a must for when the server closes too. Perhaps also for shutdowns…?

2 Likes

I was already doing that, ill still mark it as the solution tho, thanks

1 Like

you should probably just do:

game.Players.PlayerRemoving:Connect(Function()
game:BindToClose()
end)

or it was something like that

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.