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

Clone script only cloning once instead of repeating?

Asked by 3 years ago
Edited 3 years ago

I am attempting to make something that clones a brick repeatedly on a timer. But it isn't working. Someone else's post on the DevForum said to move the script into a different brick and have it work from there but that isn't working either. I also tried turning it into a function and I am just very confused. Also I can't use Instance.New because the place that I am spawning from is a moving object. Here is my script:

local MarbleL = script.Parent.Parent.Parent.MarbleLeft:Clone()
local Marble1 = script.Parent.Parent.Parent.MarbleLeft




function CreateMarble()
    wait(1)
    Marble1:Clone()
    MarbleL.Parent = game.Workspace.TireMarbles
    MarbleL.Transparency = 0
    MarbleL.CanCollide = true
    MarbleL:ClearAllChildren()
    print("Working")
end
while 1 < 5 do
CreateMarble()
end

I hope I formatted this right, thanks in advance for your help :) Edit: I only started scripting like 2 days ago so if my scripting is sloppy or bad that's probably why

1 answer

Log in to vote
1
Answered by 3 years ago

replace line 9 with local MarbleL = Marble1:Clone()

0
You're a lifesafer man! Thank you so much :) JimmieCaughtRona 0 — 3y
Ad

Answer this question