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

Cloning Script In Random Pos Help?

Asked by 10 years ago
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

I want it to clone something in lighting and place it in those random cordinates.

0
What in the code is not working? Please explain. gskw 1046 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

This may or may not work, I didn't test it. If you still want CFrame that is fine, but I used Vector3. You would've had to wait for a long time due to the wait() you added, so I put it at the bottom.

for i = 0, 10 do
    local clone = game.Lighting.LobbyCoin:Clone()
    clone.Parent = workspace
    clone.Position = Vector3.new(math.random(-93, -9),math.random(88,96),math.random(-11, 87))
    wait(math.random(50,100))
end
Ad

Answer this question