This script is from the Pits of Inferno Quest. I want to remove the item as we pass the teleport so it can be used only one time. As we passa the teleport the item desapears. Thanks
local destinations = {
[2000] = Position(32791, 32331, 10),
[2001] = Position(32791, 32327, 10)
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
if player:getItemCount(1970) < 1 then
player:teleportTo(fromPosition)
return true
end
player:teleportTo(destinations[item.uid])
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
local destinations = {
[2000] = Position(32791, 32331, 10),
[2001] = Position(32791, 32327, 10)
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
if player:getItemCount(1970) < 1 then
player:teleportTo(fromPosition)
return true
end
player:teleportTo(destinations[item.uid])
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end