im not good at explaining but i’ll try. For is a loop where it repeats until it ended.
Example:
for (Variable Name) = random1, random2, --(Adding value. Add a negative sign so it would subtract if the starting value is higher than ending value) do
-- script
wait() --Seconds until it repeats again
end
I think you should make random1 local random1 = math.random(150,249).
The script will not proceed until for do is finished
although i should just send u da link,
but ill try to explain it by myself:
for i = 1, 10 do
print(i) -- 1 2 3 4 5 6 7 8 9 10
end
for i = 1, 10, 2 do
print(i) -- 1 3 5 7 9
end
for countin = 5, 1, -1 do
print(countin) -- 5 4 3 2 1
end
for banana = 9, 4, -3 do
print(banana) -- 9 6
end
to summarize, a for i loop’s structure is
for [index name] = number a, number b, number c do
[stuff]
end
it will run [index name] from a to b ( or b to a if b>a, in dis case, number c is da decreasemet and is required for da loop to run ( c<0) )
each time it does, it will run [stuff]. if a<b, then number c ( increasement ) is optional
for i = 1, 10 do --i stores the current number.1 is the first number to be counted and 10 is the last.
print(i) --since i stores the number, it would print
--1
--2
--3
--etc.
end --This closes the for loop.
--You can also do
for i = 1, 9, 2 do --2 is the skip count, so it would print 1, 3, 5, 7, 9
print(i)
end