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

How does one add a boolvalue variable in a while true do loop?

Technovalley = 0
while wait() do
	Technovalley + 1
	if Technovalley == 5 then
		return end
	end
end

2 comments

0

what does this even mean explain yourself

0

I think he wants to add + 1 using a loop, if that's what he means then you should do Technovalley = Technovalley + 1 (sorry if that's not what you mean.)

1 answer

✓ Accepted answer

I don't think you mean Bool values, as those are just either values that equates to true or false. Rather, I think you mean you need help adding with the "Technovalley" variable, which holds an integer. Also, you cannot use return to go out of the loop, as it only works for functions. You need to use break.

To add to that variable, all you need to do is:

local Technovalley = 0
while wait() do
	--To add to a variable, do this:
	Technovalley = Technovalley + 1
	if Technovalley == 5 then
		break
	end
end

4 comments

0

This is why you don't use while wait() do. That could easily be shortened as while Technovalley ~= 5 do.

0

That is also true, however I am only fixing with what the OP has originally.

2

while wait() and Technovally < 5 do ... end @0x

2

you could just use a numeric for loop for this purpose :p

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