Jump to content

Goto line in lua


Recommended Posts

Posted

Hi,

I don't know if it's the right section, but I think it's the right one.

Is it possible to label a bunch of code and then go to it with the function goto label.

Like:

(I know this code isn't anything, just for an example xD)

A:
if a == b then
  a = a + b
end

and then later on in your script

if a == b then
  goto A
end

So my question is: Is this possible, if yes, how?

Greetz,

MILKSHAKE.

Posted

What's wrong with this?

function FuncA()
if a == b then
    a = a + b
end
end

if a == b then
  FuncA()
end

Posted

and tbh - try avoid programming based on "goto" idea - it's nothing good

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...