"Not running script because past shutdown deadline"

I was scripting and almost everytime I pause/leave the game studio will freeze for about 30 seconds and the output will say

  20:37:03.100 - Not running script because past shutdown deadline (x11)

--and DataStore2 also doesn't work.

  20:37:04.385 - ServerScriptService.MainModule:389: save error! HTTP unknown error (HttpError: ConnectFail)
20:37:04.386 - Stack Begin
20:37:04.387 - Script 'ServerScriptService.MainModule', Line 389 - function Save
20:37:04.387 - Script 'ServerScriptService.MainModule', Line 635
20:37:04.388 - Stack End

It doesn’t show me where the error is. What can I do to fix this?

2 Likes

this means there is code running after the game closes, and it wont run it because it is runs too long after the game has closed.

1 Like

I have some while loops in my game, could that be the issue?

1 Like

hmm, well i cant tell you exactly since it dont know how your scripts work, but that does sound like a cause.

2 Likes

try looking at this post:

2 Likes

I tried this script

local rs = game:GetService("RunService")

game:BindToClose(function()
    if not rs:IsStudio() then
		        for i,v in pairs(game:GetDescendants()) do
				if v.ClassName then
				if v.ClassName == "Script" or v.ClassName == "LocalScript" then
					v.Disabled = true
				end
			end
		end
    end
end)

I ran studio five times in a row and the error didn’t happen, it worked.

1 Like

This bug still happens to me even without datastore2 or bindtoclose() in my game. Any loop will also error with script exhaused execution time during the freeze