ilnaz Posted August 6, 2018 Share Posted August 6, 2018 markerData = { location = '1', { [1] = { 1216, -1835, 13.4}, [2] = { 1227.7, -1854.6, 13.4}, }, location = '2', { [1] = { 0, 0, 0}, [2] = { 1227.7, -1854.6, 13.4}, }, location = '3', { [1] = { 1216, -1835, 13.4}, [2] = { 1227.7, -1854.6, 13.4}, }, } local selLocation = 2 for _,tab in pairs(markerData) do if tab['location'] == selLocation then local x, y, z = markerData[ID][1], markerData[ID][2], markerData[ID][3] -- Problem markerData[ID][1] end end Link to comment
Addlibs Posted August 7, 2018 Share Posted August 7, 2018 I would refer you to Specifically, use code markings to make the code readable and tell us what the problem is, don't just paste your code. Tell us what is your issue, any errors you get, and what the intended behaviour is. Link to comment
SycroX Posted August 7, 2018 Share Posted August 7, 2018 local selLocation = 2 markerData = { [1]= { [1] = {1216, -1835, 13.4}, [2] = {1227.7, -1854.6, 13.4} }, [2] = { [1] = {0, 0, 0}, [2] = {1227.7, -1854.6, 13.4} }, [3] = { [1] = { 1216, -1835, 13.4}, [2] = { 1227.7, -1854.6, 13.4} } } for index,value in pairs(markerData[selLocation]) do local x, y, z = value[1], value[2], value[3] end 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