I’m a new scripter and my first language was Qbasic back in school.
So, in Qbasic you can use “GOTO” which basically takes you to the specified line of code. I used this and if then else to code a quiz thingy in Qbasic.
Example : GOTO 65
(takes you to line number 65 in your code and does whatever is in line 65)
Can this be done in Roblox?
2 Likes
uhi_o
(HAT3UBERALLES)
July 4, 2021, 5:52pm
#3
No sadly.
But there’s always a way to counter GOTO
and replace it with something else such if statements or functions.
1 Like
This is probably achievable with functions, like so:
local e = "hi"
if e == "hi" then
jump()
end
local function jump()
h.Jumping = true
end
1 Like
OP was asking if you can execute specific lines, like with GOTO
in qbasic, he was not talking about CTRL+F.
Example of GOTO
in qbasic:
1 PRINT "first line" : GOTO gohere
2 PRINT "second line": GOTO 3
gohere:
PRINT "third line"
GOTO 2
3 END
Output:
first line
third line
second line
He want’s to accomplish something like this, but with Lua.
tobo_ggan
(tobo_ggan)
July 4, 2021, 6:16pm
#6
Oh, alright. I have a very little amount of experience in programming.
cxmeels
(cxmeels)
July 4, 2021, 6:31pm
#7
You’re looking for functions.
local function sayHello()
print("Hello!")
end
sayHello() --> "Hello!"
1 Like
Goto
was added in Lua 5.2 . Roblox Luau is based off of Lua 5.1 and they have already said they will not port goto
back. See the Luau compatibility page for more info.
14 Likes
You could just copy paste a line to the command bar.
Lukiraq
(borge)
March 9, 2025, 5:13pm
#14
CTRL + G
Lets you go to a specific line of your script
Is this what u ment? (Then u can copy this line into command prompt)