I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).
What I'm trying to make is a movements script which will teleport my character a floor down when walked on and adds the 'watersplash' effect. So far I have placed a blank item behind my waterfall, item id: 4329' edited it with the otm.itemeditor so it can be walked on. Further i tried to make the script below but ran into some problems.
If possible the action id can be removed since it's quite useless.
I get this error when I walk on the sqm placed behind the waterfall.
Any help is welcome.
Thanks in advance.
What I'm trying to make is a movements script which will teleport my character a floor down when walked on and adds the 'watersplash' effect. So far I have placed a blank item behind my waterfall, item id: 4329' edited it with the otm.itemeditor so it can be walked on. Further i tried to make the script below but ran into some problems.
Code:
<movevent event="StepIn" itemid="4329" script="others/waterfall.lua"/>
Code:
function onStepIn(cid, item, Position)
if item.actionid == 55556 then
doTeleportThing(cid,{x = toPosition.x, y = toPosition.y, z = toPosition.z - 1})
doSendMagicEffect({x = toPosition.x, y = toPosition.y, z = toPosition.z - 1}, CONST_ME_WATERSPLASH)
end
return true
end
I get this error when I walk on the sqm placed behind the waterfall.
Code:
[14/08/2014 22:09:23] Lua Script Error: [MoveEvents Interface]
[14/08/2014 22:09:23] data/movements/scripts/others/waterfall.lua:onStepIn
[14/08/2014 22:09:23] data/movements/scripts/others/waterfall.lua:4: attempt to index global 'toPosition' (a nil value)
[14/08/2014 22:09:23] stack traceback:
[14/08/2014 22:09:23] data/movements/scripts/others/waterfall.lua:4: in function <data/movements/scripts/others/waterfall.lua:1>
Any help is welcome.
Thanks in advance.