data:index(x, y, z) = attempt to call method 'index'
Hi, I tried to make a simple mod and I used code from the wiki.
But the line
throws an error
I'm not really familiar with lua yet, so I'm struggling a little bit. What does the : mean in this situation? Is it a method call, in this case the method "index" from a table? I couldn't find a reference yet
I looked at some other code. I changed data:index to area:index and the code runs without errors, but also without the expected result.
Is there an error in the code?
But the line
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local vi = data:index(minp.x, y, z)
throws an error
attempt to call method 'index' (a nil value)
I'm not really familiar with lua yet, so I'm struggling a little bit. What does the : mean in this situation? Is it a method call, in this case the method "index" from a table? I couldn't find a reference yet
I looked at some other code. I changed data:index to area:index and the code runs without errors, but also without the expected result.
Is there an error in the code?