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

How to fix script time out allowed execution time ?

local spike = game.ServerStorage:WaitForChild("Spike")
local danger = game.ServerStorage:WaitForChild("Danger")
local X = Instance.new("NumberValue")
local Z = Instance.new("NumberValue")

while true do
	X.Value = math.random(-72,  -65)
	Z.Value = math.random(-110, 26)
	local spike2 = spike:Clone()
	local danger2 = danger:Clone()
	danger2.Parent = game.Workspace
	danger2.Position = Vector3.new(X.Value, danger2.Position.Y,  Z.Value )
	spike2.Position = Vector3.new(X.Value, spike2.Position.Y,  Z.Value )
	wait(1.5)
	spike2.Parent = game.Workspace
	danger2.Parent = nil
end

2 comments

0

try putting a print statement before the wait() and see if it outputs anything

0

nothing

2 answers

Your script runs too fast, maybe add a wait in the while true loop.

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