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

Is there a way to go to a specific line?

I want to make the script repeat a line unless the variable is true I think it is go to but it wont work I think it should be like this but it doesn't work

if script.parent.parent.Value.Value == 0
then ee = false 
else go to line 1

Thank you if you answer!

9 comments

0

Just do “repeat wait() script.Parent.Parent.Parent.Value.Value = 0 until ee == true”

0

It’ll also be a good idea to look up loops on the wiki

0

Dragon, I don't think your code matches up with what he is asking.

0

stop repeating the same question

0

The last question answer was wrong.

0

there is still no need for a duplicate, multiple people can answer the same question

0

I accidentally pressed delete trying to edit

0

Also i wrote the question wronf

0

Sorry for wrong spellings and sorry for repeating the question

1 answer

✓ Accepted answer

##Question

Is there a way to go to a specific line?

##Answer Not in lua 5.1.x. Though in 5.2.x+ there is a GOTO statement I think

###Solution To Problem We can use a loop of some sort. Based of this wording "repeat line unless the variable is true" we can use a repeat x until y or we can use while y do x end

I believe repeat sounds better in this case.

local parent = script.Parent
local doubleParent = parent.Parent
local valueObject = doubleParent.Value

local value = valueObject.Value
local ee = true

repeat
	value = valueObject.Value --// set value to newest value
	wait() --// prevent game hanging
until value == 0

ee = false --// finally set `ee` to false since `value` became 0

4 comments

0

Thank you very much!

0

Shouldn't there be 1 value

0

The second declaration of value is to handle incase the original value variable has been updated since.

0

Thank you very much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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