So I have while true do
scripts and also for i = x, x, x
scripts. How would I put an end to the loop if a condition is met?
like if there's a number value that reaches a certain number the loop stops? Please help.
If its possible i would like a example.
break
breaks your loops.
local potato = 1 while true do potato = potato + 1 if potato == 10 then break end end
break
breaks a loop, iterator, or function.
It has to be lower-case by the way.
break
return
does end a function but not for loops, it's just used for returning a value.
Every loop has some sort of an [ending]
This would lead you to the case; how do i stop this? Well, as i said, loops has an ending to it. In several scenarios, one may understand the difficulty of leading loops to its very last point, the greatest way of stopping loops such as a while loop or a for loop to name a few is by simply using the 5-lettered word:
break