MetaGamer Posted November 1, 2011 Share 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. Link to comment
SDK Posted November 1, 2011 Share 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 Link to comment
Phat Looser Posted November 4, 2011 Share 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. Link to comment
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