Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats the error in this script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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.

0
Anyone? Bump RolandStudio 115 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

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
0
No I wanted it to go on forever. RolandStudio 115 — 10y
Ad

Answer this question