Nathan.S wrote:...this currently just crashes I tried using minetest.get_item_group but got no place with that either. I just need to compare location of a node, to the name of a node.
The expression:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
is not valid (it should even cause a syntax error). You probably want:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
or, better yet:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
("~=" is Lua's not-equal-to operator, "==" is Lua's equal-to operator, and "=" is Lua's assignment operator).
EDIT: To clarify further, curly braces ({}) in Lua create a new table object. Provided what is inside them is valid table syntax, a table will always evaluate to true (everything but nil and the boolean value false evaluate to true). However, table syntax also requires entries separated by commas, with each entry either being a simple value or a key-value pair. A key-value pair DOES separate the key and value by a single equals (=) character, but the key must either be a simple identifier-style name or an expression in square brackets ([]), whose value is used as the key. So valid examples are:
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
{ 3, 2, 1, "contact" } -- Implicit keys 1, 2, 3, 4; table treated as array
{ x = 1, y = 5, name = "Fred" } -- Simple names "x", "y", "name" as keys
{ [x+1] = 1, [y-1] = 5, [name] = "Fred" } -- Keys are derived from the values of the x, y, and name variables, not the strings "x", "y", and "name"