<action itemid="ITEM_ID_HERE" script="name.lua"/>
local config = {
teleportTo = {x=3333, y=5555, z=7} -- position the player will be teleported to
}
function onUse(cid, item, frompos, item2, topos)
if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
doTeleportThing(cid, config.teleportTo)
doSendMagicEffect(config.teleportTo, 10)
else
doPlayerSendTextMessage(cid,22,"You can only use this item inside protection zone!")
end
return true
end
Since there is no function which checks the temple, this script can be used only on pz tiles.
can use function in area from pos to pos