can you like clone a model a number of times using Values and stuff?if so how?
You could clone it multiple times, by creating multiple references to it and working with them separately or, by looping the the cloning action.
both s
and s1
are references to the same table
local s = {value = 'Scripting'} local s1 = s -- therefore print(s.Value) --[[would return the same output as]] print(s1.Value)
you could then create multiple references to the clone of a specified item.
NB: Changing the value of s
will not change the value of s1
You could also use a loop (while, repeat, generic for)
local my = workspace.Camera for i = 1, 10 do my:clone() end
Resources: Loops
Yeah, you can do that using the for
loop. The first argument (value) is a starting point, which is a variable assignment (in this case is going to be i
to the number 1), the second argument is the end point (a simple answer is that the loop doesn't stop counting until the end point is reached.) So if you put in 1 and 3, it will activate three times. Use the code below:
for i = 1, 3 do -- Change three to how many times local newThing = thing:Clone() newThing.Parent = workspace -- Or wherever you want to parent it. -- An alternative version is thing:Clone().Parent = wherever, but I broke it down to help end