"Not running script because past shutdown deadline"

So i have been working recently on my game and ive noticed everytime i stop the game on studio it freezes my studio for a couple seconds and says on output “Not running script because past shutdown deadline” . if you know a solution to this please tell me.


I am having the same problem than you. I heard it’s a bug in studio (even if you wait 1 second in BindToClose or do anything that yields for example saving player data) it will freeze for 30 seconds. Check out the bug here BindToClose 100% Infinite Yield


Did this start recently? Are you using DataStore2?

1 Like

I am using DataStore2 and I’m having the exact same issue as him. So I’m assuming he is.


This is happening to me as well, but I am using data store.

I got around this by checking if it’s currently not in studio mode:

local rs = game:GetService("RunService")

    if not rs:IsStudio() then
1 Like

Yeah, as @SiberianCatKitten said, this is a Roblox Studio bug and has nothing to do with DataStore2 or your own code, unless you’re actually taking longer than thirty seconds. You’ll have to avoid yielding from BindToClose callbacks in Studio (game:GetService("RunService"):IsStudio()) to prevent this, or wait out the thirty seconds.

@LandofLee1620 @Kotojo

1 Like

How did you get around it by using that function? Where in the code do you place it, because it’s not working for me haha

1 Like

Yeah I noticed this recently and I’m not using Datastore2 just regular SetAsync

I just checked in my BindToClose function if it’s Studio or not, infact you could have this at the top of the function:

if game:GetService("RunService"):IsStudio() then return end

Can anyone else confirm that they’re still getting this problem? As of today I’m still having this issue with Kohls admin. I will use the work-around for now.

1 Like

This is how I handle my BindToClose and it works fine in studio and live.


– BindToClose in case game fails or disconnects for some reason

-- print("game:BindToClose has been fired")

				local success, errorMessage = pcall(function()
							-- your code goes here
				if not success then
					print("[SERVER BindToClose] Error "..errorMessage);