Does anyone know what this error means? My error webhook threw it at me while some people were playing my game without me noticing (in development). I looked it up and found nothing. My guess is I’m trying to call :BindToClose while the game is already being shut down?
This happened to me too, this needs the have an answer, does anybody know one yet?
Well I know why it’s happening, but I don’t think there is a way w/ the current API to fix it.
Basically, the error is thrown when the server is already in the process of shutting down, and then you attempt to bind to close with
game:BindToClose(func)
Any nice way to resolve this would be if game DataModel had an exposed property like “IsShuttingDown” and that way you could write your code as:
if not game.IsShuttingDown then
game:BindToClose(func)
else
func() --maybe try to run your func anyway? But be aware the server would not “wait” for this function to finish
end
Since I see no property on the datamodel to detect if the game is shutting down, I’m just gonna through my blindtoclose into a pcall
Note for future forum travelers keywords: I am getting this error as a result of my “Soft Shutdown” script that creates a private “lobby” place to hold my players in the interim during an update shutdown. I figure my temporary lobby place is being created & shut down so quickly that my code that has :BindToClose doesn’t have enough time to get called before the server is already shutting down again, or perhaps 1-3 servers have JUST been instantiated when I shutdown all my servers, cause the quick Shutdown turnaround.
Other options to fix: Move your :BindToClose to the “start” of whatever script you have it in.
Or also, create a new :BindToClose, in a new script, that’s only job is to set a flag for whether or not the game is shutting down. Your other scripts can reference that flag.
Is this only a problem in studio? I’m wondering for myself.