Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What does it mean when a script is "exhausted allowed execution time"? Please help. . .

Ok, so I am trying to make a zombie spawn thing for my game. A zombie fighting game, who would have figured? Anyways, an error appears when I run the game:

Script timeout: exhausted allowed execution time

I don't know what this means to I researched it. I know what It means but i don't know how to fix it. I also searched that up (P.S. I am using a repeat loop) and I just need to add a wait() https://scriptinghelpers.org/questions/76821/t? so I did:

repeat wait()

Still doesn't work, and I am stumped, heres the code:

local norm = game.ReplicatedStorage.Zombie
local locONE = workspace.spawnlocations.locONE
local locTWO = workspace.spawnlocations.locTWO
local locTHREE = workspace.spawnlocations.locTHREE

repeat wait()
	local clone = norm:Clone()
	clone.Parent = workspace.workzombie
	clone.UpperTorso.CFrame = locONE.CFrame
	workspace.wave.Value = workspace.wave.Value + 1
	
until workspace.wave.Value == 50000

Here is a Youtube video of this problem:

https://youtu.be/s0krstX_LEE

LEE lol, anyways thanks for the help!

2 comments

0

try putting a numerical value into the wait() like 1? because without a numerical value, it will repeat rapid fire, too fast for the game to handle?

0

still same problem, but thanks!

1 answer

✓ Accepted answer

Here you go. The repeat loop is running too fast, so you need to add a wait() at the end. Like this:

local norm = game.ReplicatedStorage.Zombie
	local locONE = workspace.spawnlocations.locONE
	local locTWO = workspace.spawnlocations.locTWO
	local locTHREE = workspace.spawnlocations.locTHREE
	 
	repeat wait()
	    local clone = norm:Clone()
		wait(0.05)
	    clone.Parent = workspace.workzombie
		wait(0.05)
	    clone.UpperTorso.CFrame = locONE.CFrame
	wait(0.05)
	    workspace.wave.Value = workspace.wave.Value + 1
	 wait(0.05) -- the wait that I added
	until workspace.wave.Value == 50000

Hope I helped!

3 comments

0

Still the same problem for some reason :/, https://youtu.be/k_DgBFeyAhg theres the new video of it just in case, thanks anyway!

0

I changed the answer, try it now.

0

thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.