Hi devs,
this happened to my studio while play testing a game, i know why the error occured, but i dont know why it would crash. After the screen shot was taken, it returned to normal and i got this error message in the output 18:22:59.914 Not running script because past shutdown deadline - Server - Team Handler:175
Heres my script, and when i clicked on the deadline error, it directed me to the task.wait(7)
workspace.DescendantAdded:Connect(function(child)
if child:IsA("Highlight") then
local parent = child.Parent
if not parent then return end
parent:GetAttributeChangedSignal("Vulnerable"):Connect(function()
if parent:GetAttribute("Vulnerable") == false then
task.wait(2)
child:Destroy()
end
end)
end
task.wait(7)
for i, v in game:GetDescendants() do
if v.Name == "Firewall" then
task.wait(.7)
v:Destroy()
end
end
end)
I tried again with some edits and got this error about a hundred times: 18:29:34.161 Script timeout: exhausted allowed execution time for the current resumption point - Server - Team Handler:164 from my main script team handler, but i also got it on some scripts i never knew existed… Do i have a virus?
It’s bcus i want it to wait 7 seconds after the firewalls are added to destroy themz then when i do that, i want there to be a delay between each firewall being destroyed.
Using both workspace.DescendantAdded and assets:GetDescendants together is overkill and will fire constantly.. Not even sure if this will work for you, but it’s far less intense:
local assets = game.ServerStorage:WaitForChild("Assets")
assets.ChildAdded:Connect(function(firewall)
if firewall.Name == "Firewall" then
task.spawn(function()
task.wait(7)
firewall:Destroy()
end)
end
end)
it’s because the code is waiting too long which is making the loop run far past when you close the game. Try reducing the task.wait() time. If you really need the waits though, you can wrap the code in a task.spawn(function(). Or you could just not loop through every file in your game
The issue is this, you repeatedly check descendants which is resource intensive. It would be better if you used Debris if synchronization is not needed when destroying “Firewalls.” If it’s needed, you could consider storing them in a list upon instantiation, to delete them when required.
A virus would not be using Rodux. It’s likely an error coming from shoddy code on Roblox’s end.
Instead of using game:GetDescendants() and filtering every instance in your GAME (that’s not just the workspace—that’s your entire game!), you should use CollectionService.
this isnt a virus, this just means that the thread at line 164 is taking too long to run. no idea what thread that is but i’m guessing its the ,descendantadded connection. the reason the output lead you to the task.wait(.7) loop was because it was wrapped in the for i, v in game:GetDescendants() do, which for future reference, you should never do. so what i suggest you should do is using numerical looping instead.
local descendants = game:GetDescendants()
for i = 1, #descendants do
local currentIdx = descendants[i]
print(currentIdx)
if currentIdx.Name == "Firewall" then
task.wait(.7)
currentIdx:Destroy()
end
end
Tganks everyone! A lot to read lol! I will probably instead of putting the "Firewalls straight into workspace, put them into an aasets folder or smthn, so i van check when a child of that is added. But what i want is that it will wait after the first firewall is added for about 7 seconds, then there would be a slight delay between each firewall. If anyone knows forsaken, i want it to be like john does spikes.
local assetsFolder = workspace.Assets
assetsFolder.ChildAdded:Connect(function(child)
for i, v in assetsFolder:GetChildren do
if i == 1 then
task.wait(7)
else
task.wait(0.7)
v:Destroy()
end
end
end
Ikk you guys said not to do .Child added then loop through them, but i wanna check if the spike is the first one added, and i want the script to run when the spikes appear.