Thorn
Spriting since 2013
Hello guys, i have tfs 1.3, and im trying to add an addevent so lever goes back to it's original position and also the floor (this is from lighthouse quest) but i can't make it work, anyone knows why im failing??
and the error is
LUA:
if item.itemid == 1945 then
laddertile:getItemById(9021):transform(8280)
item:transform(1946)
addEvent(function(laddertile, Tile)
laddertile:getItemById(8280):transform(9021) -- Create pillar
laddertile:sendMagicEffect(CONST_ME_POFF) -- Send POFF effect
item:transform(1945) -- Flip lever to the left
end, 3000, laddertile:getPosition(), Tile(toPosition):getItemById(1946))
else
laddertile:getItemById(8280):transform(9021)
item:transform(1945)
end
and the error is
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/thaislighthouselever.lua:onUse
luaAddEvent(). Argument #4 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/actions/scripts/quests/thaislighthouselever.lua:8: in function <data/actions/scripts/quests/thaislighthouselever.lua:1>
Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/actions/scripts/quests/thaislighthouselever.lua:9: attempt to call method 'getItemById' (a nil value)
stack traceback:
[C]: in function 'getItemById'
data/actions/scripts/quests/thaislighthouselever.lua:9: in function <data/actions/scripts/quests/thaislighthouselever.lua:8>