Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Loop won't break, help?

This is the loop:

while wait(0.2) do
	f.Size = f.Size +0.2
	if f.Size == 8 then break end

It completely ignores the break and keeps going to the max size.

Not sure how to fix, any help would be appreciated.

2 answers

✓ Accepted answer

I think it has to do with the decimals being involved, making f.Size a float rather than an integer. Although I don't see why that would be a problem. I'm quite honestly not sure why it occurs for you.

However, you can solve this very easily by taking use of the condition of the while-loop.

while (f.Size < 8) do
	f.Size = f.Size + 0.2
	wait(0.2)
end

You could eventually do "if f.Size >= 8 then break end" too, although I personally prefer the abovementioned.

1 comment

0

Thanks, this worked, it stopped at 8.2 but I know how to fix that.

Try this

while true do
wait(.2)
 f.Size = f.Size +0.2
    if f.Size == 8 then 
break
 end

1 comment

0

It didn't work, it just continued past it.

This discussion is preserved as it was. New answers, comments, and votes are closed.