Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.