how to make the monster use teleport?
Lua:
local teleport = MoveEvent()
function teleport.onStepIn(creature, item, position, fromPosition)
if creature:isMonster() then
if creature:getName() == "Rat" then
return true --false?
end
if item.actionid == 42555 then
creature:teleportTo(fromPosition)
end
end
return true
end
teleport:type("stepin")
teleport:aid(42555)
teleport:register()