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

How to forever increase an int value's value until a certain point?

I've been trying to make an int value's value increase until it reaches 692, the first part of the script doesn't work, and I don't know how to break loops. Definitely need some help with this one.

while true do
	script.Parent.Value = script.Parent.Value + 1
	wait(0.005)
end

1 answer

✓ Accepted answer

i guess you could do a while true do loop but you need something to signify it to stop.

Step one:

add a variable, any variable.

local variable = true

while variable == true do
--code here
end

Step two

if you are adding a bool value or any value, do this:


local value = youValueHere

value.Changed:Connect(function()
while value == true do
--code here
end

while value == false do
--code here
end

end)

1 comment

0

i think you could also make a coroutine or spawn function.

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