Need help with :BindToClose() and :PlayerRemoving()

what is a good way to make it so that if :BindToClose() runs then :PlayerRemoving() doesn’t run

like if the last player leaves or everyone is kicked I would only want a :BindToClose() to run
that’s an example

literally can’t go on studio until July 4th and ima be real busy so I just need to know this beforehand

thanks, doryu

Have a variable outside of the functions so that when the function runs it changes the variable to prevent playerremoving from working

BindToClose runs before PlayerRemoving right?
if so that should work perfectly

cuz BindToClose should run 30 seconds before the game shuts down