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 4 years ago
Edited 4 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:

01local MarbleL = script.Parent.Parent.Parent.MarbleLeft:Clone()
02local Marble1 = script.Parent.Parent.Parent.MarbleLeft
03 
04 
05 
06 
07function CreateMarble()
08    wait(1)
09    Marble1:Clone()
10    MarbleL.Parent = game.Workspace.TireMarbles
11    MarbleL.Transparency = 0
12    MarbleL.CanCollide = true
13    MarbleL:ClearAllChildren()
14    print("Working")
15end
16while 1 < 5 do
17CreateMarble()
18end

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 4 years ago

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

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

Answer this question