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
COMMUNITY QUESTION
How to fix script time out allowed execution time ?
2 answers
nvm it did but same error !!
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.

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