function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == your_id_of_itemid and itemEx.itemid == your_id_of_itemid_2 then ---< change
doTeleportThing(cid, {x=,y=,z=})
end
return true
end
local config = {
removeOnUse = true, -- true / false
useEffect = true -- true / false
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
doTeleportThing(cid, {x = 100, y = 100, z = 7}, false)
if(config.removeOnUse) then
doRemoveItem(item.uid, 1)
end
if(config.useEffect) then
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
end
return true
end
There's no need to check for the item ID, Seminari. That is what you do within the actions.xml file.
^_^LUA:local config = { removeOnUse = true, -- true / false useEffect = true -- true / false } function onUse(cid, item, fromPosition, itemEx, toPosition) doTeleportThing(cid, {x = 100, y = 100, z = 7}, false) if(config.removeOnUse) then doRemoveItem(item.uid, 1) end if(config.useEffect) then doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) end return true end