Jump to content

Tables


Wisam

Recommended Posts

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
  • 2 months later...

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

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 by Guest
Link to comment
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
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
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

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...