.:HyPeX:. Posted March 1, 2014 Share Posted March 1, 2014 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? Link to comment
Castillo Posted March 1, 2014 Share Posted March 1, 2014 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 Link to comment
.:HyPeX:. Posted March 2, 2014 Author Share Posted March 2, 2014 What i actually wanted was the myTable [ 6 ] thingy, all i wanted is how to retirve °6 value. Link to comment
Castillo Posted March 2, 2014 Share Posted March 2, 2014 Ah, well, there you see how it is. Link to comment
Moderators Citizen Posted March 2, 2014 Moderators Share Posted March 2, 2014 And if you mean't the last value in a table: local value = myTable[ #myTable ] 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