Okay so I want a script to play 5 times but without copying the same script over and over. How do I this?
Using a for loop you can run the same peice of code multiple times, while still only writing it once.
function DoSomething(Num) print(Num) end for i = 1, 5 do -- Start at i = 1 and increase i (by one) until it's more than 5 DoSomething(i) end --- Output: -- 1 -- 2 -- 3 -- 4 -- 5
Just put what you want to execute in a function. Then call it 5 times either using a for loop or calling the function 5 times.
function doCode() --Do Stuff end for i = 1, 5 do doCode() end -- OR doCode() doCode() doCode() doCode() doCode()