✓ Accepted answer
Here is the code, I will explain after:
local item = your item
local randomnumber = math.random(1, 9)
for i = 1, randomnumber do
item:Clone()
end
What this does, is it creates a random number and then does a loop that number of times. Every time it goes through the for loop, it adds 1 to i. The loop will break, or stop when i reaches randomnumber. You can additionally set the position, or whatever of each part like this:
local item = your item
local randomnumber = math.random(1, 9)
for i = 1, randomnumber do
local new = item:Clone()
new.Position = Vector3.new(0, i, 0)
end
Hope I helped!
4 comments
hello world!
for i = 1,randomnumber do (--insert code here--) end
Thx!
for loops