How to add an additem or something like to teleport items thrown in the teleport to another position?
Here's the script:
Done using position to register the event:
Here's the script:
Lua:
local Teleport = MoveEvent()
function Teleport.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local potItem = Tile(Position(33145, 32862, 7)):getItemById(2562)
if not potItem then
player:teleportTo(fromPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
player:teleportTo(Position(33151, 32864, 7))
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
return true
end
Teleport:uid(1000)
Teleport:register()
Post automatically merged:
Done using position to register the event:
Lua:
local TeleportItem = MoveEvent()
function TeleportItem.onAddItem(moveitem, tileitem, position)
moveitem:moveTo(Position(33147, 32864, 7))
position:sendMagicEffect(CONST_ME_TELEPORT)
return true
end
TeleportItem:position({x = 33148, y = 32864, z = 7})
TeleportItem:register()
Last edited: