Jump to content

Table Position retrive?


Recommended Posts

Posted

hey guys, how can i retrive a value from a certain table position?

Lets say i got a 6-inserted objects table (table.insert) and i wanted to retrive the value from pos 6, How to do this?

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

By objects you mean actual objects created by createObject? if so, then you can do:

local object = myTable [ 6 ] 
if isElement ( object ) then 
    local x, y, z = getElementPosition ( object ) 
end 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What i actually wanted was the myTable [ 6 ] thingy, all i wanted is how to retirve °6 value.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

Ah, well, there you see how it is.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

And if you mean't the last value in a table:

local value = myTable[ #myTable ] 

The rEvolution is coming ...

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