MrVilhelm
Mafia Penguin
Hi! Me again !
So Im trying Lua again and Im trying to search for a target.x offset. basically what I want is that when you use an item anywhere the script checks if that position you used the item on - 9 x has an object on it.
I tried this but got an error
Sadly I failed in both occasions
Error output for the first one : attempt to perform arithmetic on field 'x' (a nil value)
Error output for the second one : attempt to call method 'getId' (a nil value)
EDIT ( Realised I was searching for a x in the first one instead of the Y, but I was searching for the Y, anywho, same error but just wanted to let you know, YES I saw I wrote it wrong XD )
So Im trying Lua again and Im trying to search for a target.x offset. basically what I want is that when you use an item anywhere the script checks if that position you used the item on - 9 x has an object on it.
I tried this but got an error
Lua:
elseif (target.x - 9):getId() == 2113 then
//I also tried
local activeTile = {
x = toPosition.x,
y = toPosition.y + 10,
z = toPosition.z
}
elseif activeTile:getId() == 2113 then
Error output for the first one : attempt to perform arithmetic on field 'x' (a nil value)
Error output for the second one : attempt to call method 'getId' (a nil value)
EDIT ( Realised I was searching for a x in the first one instead of the Y, but I was searching for the Y, anywho, same error but just wanted to let you know, YES I saw I wrote it wrong XD )