Wisam Posted March 12, 2016 Share Posted March 12, 2016 Hey guys, so i've been learning coding for a while and everything is going well i learned really good i can now build guis and link server functions to them and lots of stuff, but now im going to learn the table.. i want to know the structure of the table how to build it and what types of tables i can do and how to link them to functions, if you would like to help me please just post usefull functions or small examples of tables that'd be great Link to comment
dugasz1 Posted March 12, 2016 Share Posted March 12, 2016 http://www.lua.org/pil/2.5.html -- Table http://www.tutorialspoint.com/lua/lua_tables.htm -- Table http://www.tutorialspoint.com/lua/lua_arrays.htm -- Array (basically table in table) Just read these. I think its enough to understand. Link to comment
Wisam Posted March 13, 2016 Author Share Posted March 13, 2016 http://www.lua.org/pil/2.5.html -- Table http://www.tutorialspoint.com/lua/lua_tables.htm -- Table http://www.tutorialspoint.com/lua/lua_arrays.htm -- Array (basically table in table) Just read these. I think its enough to understand. Thank you mate its helpful, can you just put an example here of a simple table Link to comment
Bean666 Posted June 8, 2016 Share Posted June 8, 2016 here is an example of a marker table when you add more arrays , don't forgot to add at the end of the arrays with , but don't add , in the last array! local markers = { { x, y, z }, { x, y, z } } for i,v in ipairs( markers ) do createMarker ( v[1],v[2],v[3], type/kind, size, r, g, b, a ) end Link to comment
Anubhav Posted June 9, 2016 Share Posted June 9, 2016 (edited) Or this: local stuff = {} stuff[1] = {1, 2, 3} stuff['proThingBro'] = {131931,3131,13131} for i, v in pairs( stuff ) do local string = tostring( v[1] ) ..","..tostring( v[2] )..","..tostring( v[3] ) outputChatBox( string ) end They're very useful for many things. You can use them for complicated stuff too, and they also are fast. Edited June 10, 2016 by Guest Link to comment
Bean666 Posted June 10, 2016 Share Posted June 10, 2016 Or this: local stuff = {} stuff[1] = {1, 2, 3} stuff['proThingBro'] = {131931,3131,13131"} for i, v in pairs( stuff ) do local string = v[1]..","..v[2]..","..v[3] outputChatBox( string ) end They're very useful for many things. You can use them for complicated stuff too, and they also are fast. is that an unfinished string or it's normal? 131931,3131,13131" Link to comment
Enargy, Posted June 10, 2016 Share Posted June 10, 2016 Or this: local stuff = {} stuff[1] = {1, 2, 3} stuff['proThingBro'] = {131931,3131,13131"} for i, v in pairs( stuff ) do local string = v[1]..","..v[2]..","..v[3] outputChatBox( string ) end They're very useful for many things. You can use them for complicated stuff too, and they also are fast. is that an unfinished string or it's normal? 131931,3131,13131" Of couse it does not normal. Link to comment
Anubhav Posted June 10, 2016 Share Posted June 10, 2016 Or this: local stuff = {} stuff[1] = {1, 2, 3} stuff['proThingBro'] = {131931,3131,13131"} for i, v in pairs( stuff ) do local string = v[1]..","..v[2]..","..v[3] outputChatBox( string ) end They're very useful for many things. You can use them for complicated stuff too, and they also are fast. is that an unfinished string or it's normal? 131931,3131,13131" my bad. thanks Link to comment
Wisam Posted June 10, 2016 Author Share Posted June 10, 2016 Thanks alot guys, that was really helpful im improving 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