z = math.random(-24,24) t = math.random(.009,.05) NewPart = Instance.new("Part") for i = 1, 900 do NewPart.Parent = Workspace NewPart.Size = Vector3.new(3.6, 1.2, 2) NewPart.Position = Vector3.new(22, 18.19, z) NewPart.BrickColor = BrickColor.new("Really black") for i = 1,146 do NewPart.CFrame = NewPart.CFrame* CFrame.new(0,.2,0) wait(t) end NewPart.remove() wait(5) end
Every 5 seconds, it is supposed to create one block with a random Z vector as shown at the very top. It only creates one block, and then the script stops. I think it's the NewPart.remove() , but I'm not sure. What could I try instead of that?
If you want to use the remove() function, it would be NewPart:
remove()
local t = math.random(.009,.05) for i = 1, 900 do local z = math.random(-24,24) NewPart = Instance.new("Part") NewPart.Parent = Workspace NewPart.Size = Vector3.new(3.6, 1.2, 2) NewPart.Position = Vector3.new(22, 18.19, z) NewPart.BrickColor = BrickColor.new("Really black") for i2 = 1,146 do NewPart.CFrame = NewPart.CFrame* CFrame.new(0,.2,0) wait(t) end NewPart.remove() wait(5) end