My Datastores work fine until i shut down a server... Then things go mad.

Is there a way that people usually go about saving data on server shutdown? Not sure if there is a common practice on this kind of thing or not.

5 comments

0

As mattscy said use BindToClose because PlayerRemoving does not fire on shutdown.

0

Sorry, i should have mentioned that i am using BindToClose.

0

I noticed that some players data got saved on server shutdown even before i had BindToClose in my game though. So I'm wondering if for some players it tries saving their data twice really quickly?

0

Maybe have a little wait() or maybe two seconds or so on BindToClose