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

How do you bypass the exhausted allowed execution time error?

I've been having an issue where I get the Script timeout: exhausted allowed execution time error. Can someone point me in the right direction?

repeat
	if game.Workspace.Dummy4.Humanoid.Health < 100 then
		game.Workspace.Dummy4.Humanoid.Health = 60
	end
until game.Workspace.Dummy4.Humanoid.Health == 0

1 answer

The problem you have here is that you never added a wait!

However; there's a more efficient way of writing this code!

game.Workspace.Dummy.Humanoid.HealthChanged:Connect(function(Health)
	if Health <= 100 then
		if Health <= 0 then
			
		else
			Health = 60
		end
	end
end)

This should work; if it doesn't use this instead:

repeat
	if game.Workspace.Dummy4.Humanoid.Health < 100 then
		game.Workspace.Dummy4.Humanoid.Health = 60
	end
	wait()
until game.Workspace.Dummy4.Humanoid.Health == 0

3 comments

0

ALSO: if you only want it to fire when the health is over 100 remove the = at the end of if Health <= 100 then.

0

Thanks, I'll try it

0

It worked, thank you so much!

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