Hi! :)
My question is, I want to have an if then statement in my for i do loop and the if then statement would catch when the i value got to a certain value, then it would break the for loop.
Here's my attempted code:
for i = 0, 1, 0 do
--I have code in here written that isn't related to my question, so it's not needed
if i == 0, 1, 1 then
break
end
end
I know you cant do on Line 3 "if i == 0, 1, 1 then" because in the if then statement it's supposed to be one value, not multiple values and not have the commas ( "," ) in it.
I also tried this, which didn't work:
for i = 0, 1, 0 do
--I have code in here written that isn't related to my question, so it's not needed
if i == 1 then
break
end
end
That code, I know, was kinda stupid in a way because what I wanted the if then statement to be triggered on when the third value (That value in the for loop was 0) was 1. And I always knew that code doesn't make things easy for you. :/ So can someone please try to figure out my question?
Much appreciated! ~Chez_Guy :)

4 comments
The break in your if statement is only breaking out of the current if statement which is why,
@LegitmateTrades thats what i thought.. but are you sure?
Yes, I've had this same issue before.
No, break breaks the loop