Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I save data on bind toclose if I delete data when playerremoving fires?

Asked by 4 years ago

So I have data in a folder in serverstorage but when player removing fires when they leave it saves the folder in a datastore and deletes it right away to prevent clogging up

how would I find an solution to this if player removing deletes their data folder so I can't save anything

1 answer

Log in to vote
0
Answered by 4 years ago

Easy. Your BindToClose handler can just set a flag that disables the deleting of these player data folders (PlayerRemoving handler checks this flag). If BindToClose fires, the server is definitely shutting down, so you don't have to worry about accumulating stuff in ServerStorage any more, the whole server is going to be nuked in 30 seconds, so it doesn't matter.

Ad

Answer this question