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

Whats the error in this script?

local i = 0
repeat
	wait(math.random(50,100))
	local clone = game.Lighting.LobbyCoin:Clone()
	clone.Parent = game.Workspace
	clone.CFrame = CFrame.new(math.random(-9.453,-93.575),math.random(87.8,95.95),math.random(87.413,-11.478))
until i==10

No output errors. Doesn't work.

1 comment

0

Anyone? Bump

1 answer

You forgot to add to your limiter.

local i = 0
repeat
	local clone = game.Lighting.LobbyCoin:Clone()
	clone.Parent = game.Workspace
	clone.CFrame = CFrame.new(math.random(x, x), math.random(y, y), math.random(z, z))
	i = i +1 --This is what you missed.
	wait(math.random(50, 100) --Put wait here so you won't have to wait for 50-100 seconds to try if it works.
until i == 10

1 comment

0

No I wanted it to go on forever.

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