local oldPos = {x = [B][COLOR=Red]xxx[/COLOR][/B], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B]} -- teleport position
local newPos = {x = [B][COLOR=Red]xxx[/COLOR][/B], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B]} -- position where the player will be teleported
local itemPos = {x = [COLOR=Red][B]xxx[/B][/COLOR], y = [B][COLOR=Red]yyy[/COLOR][/B], z = [B][COLOR=Red]zz[/COLOR][/B], stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE} -- position where the item need to be
local itemId = [B][COLOR=Red]xxxx[/COLOR][/B] -- item id (the item that need to disapear)
function onStepIn(cid, item, pos)
local getItem = getThingfromPos(itemPos)
if isPlayer(cid) == TRUE then
if getItem.itemid == itemId then
doSendMagicEffect(oldPos, CONST_ME_POFF)
doTeleportThing(cid, newPos, TRUE)
doSendMagicEffect(newPos, CONST_ME_TELEPORT)
doRemoveItem(getItem.uid)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport isn't activated.")
doSendMagicEffect(oldPos, CONST_ME_POFF)
end
end
return TRUE
end