05-14-2017, 03:52 AM
The error message basically says it all. You're calling TeleportToCoords with wrong arguments, it expects a cEntity as its first parameter, but you're giving it a string.
Note that in Lua, there are two "calling conventions":
obj.fn("a") -- calls obj.fn with param "a"
obj:fn("a") -- calls obj.fn with params obj, "a"
The second is what Cuberite is using everywhere and is expecting from the plugins.
The SpawnX/Y/Z need to be read with a GetValueI() function, so that they are numbers, not strings.
Note that in Lua, there are two "calling conventions":
obj.fn("a") -- calls obj.fn with param "a"
obj:fn("a") -- calls obj.fn with params obj, "a"
The second is what Cuberite is using everywhere and is expecting from the plugins.
The SpawnX/Y/Z need to be read with a GetValueI() function, so that they are numbers, not strings.