MetaGamer Posted November 1, 2011 Posted November 1, 2011 How do I have switch statement in lua? Can someone give me an example switch statement script? It's very annoying to write if, elseif multiple times.
SDK Posted November 1, 2011 Posted November 1, 2011 Usually people use tables for stuff that can be done with switch. More info & examples: http://lua-users.org/wiki/SwitchStatement Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
Phat Looser Posted November 4, 2011 Posted November 4, 2011 Tables are much faster, though, since the computer doesn't have to check 64 different variables just to find out that none fits. Officially MTA's worst fanboy
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now