Which way is better to save data?
Should i use plr.PlayerRemoving or game:BindToClose()?
They both appear to save the data.
Which way is better to save data?
Should i use plr.PlayerRemoving or game:BindToClose()?
They both appear to save the data.
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!
BindToClose only fires when the server is about to close, like @furious_cucomber said, i’d use both as a security measure
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…?
I was already doing that, ill still mark it as the solution tho, thanks
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.