Still have questions? Join our Discord server and get real time help.
0

# How to avoid "Script timeout: exhausted allowed execution time" ?

Edited 1 month ago

so i have this script which removes a folder with loathes of 2x2x2 cubes and like how to i make it avoid "Script timeout: exhausted allowed execution time" ?

here is the script :

script.Parent.MouseButton1Click:Connect(function()
if game.Workspace:WaitForChild("blocks")then
folder = game.Workspace:WaitForChild("blocks")
folder:Destroy()
newFolder = Instance.new("Folder", workspace)
newFolder.Name = "blocks"
else
newFolder = Instance.new("Folder", workspace)
newFolder.Name = "blocks"

end

end)


0
Is there any over script that's running? That error usually occurs when someone has made a while loop without putting a wait in it (therefore crashing the game). ApexBrick 59 — 1mo

0