Staff can anyone tell me what is wrong in this action?
TFS 1.2
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local wall = getThingfromPos({x=890, y=487, z=5, stackpos=1})
if item.actionid == 8000 and item.itemid == 1945 and wall.itemid == 1497 then
Item(wall.uid):remove()
Item(item.uid):transform(1946)
elseif item.actionid == 8000 and item.itemid == 1946 and wall.itemid == 0 then
Game.createItem(1497, 1, {x=890, y=487, z=5, stackpos=1})
Item(item.uid):transform(1945)
end
return true
end
TFS 1.2