How to repeat something for number of times in a value?

So I have an int value with the value of 2 I want a loop to repeat for what number is in the value so 2. But then if I change it to let’s say 4 the loop would now repeat 4 times. How would I do this?

Use a for loop.

local IntValue = ... -- path to your int value
for i = 0, IntValue.Value do
    -- code here
end
1 Like