Using game:BindToClose() multiple times?

Hello.

I’m wondering if it’s fine to use the game:BindToClose() function multiple times.
I want to send some (cached) analytics data before the server shuts down instead of sending it for each event separately (for Roblox PlayFab Analytics).

I’m asking this because the DataStore2 module already has a built-in BindToClose function but I don’t want to modify it.

Thank you

EDIT: does usage of a BindToCloes function affect another BindToClose function in any way (e.g. DataStore2’s BindToClose and saving data)?

BindToClose adds a function to be called when the server shuts down. You may bind as many as you wish, according to the documentation. These functions are called in parallel and shouldn’t affect eachother.

1 Like