• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Teleport when clicking on item.

Thaz

๖OrgeaRPG Project
Joined
Jun 5, 2008
Messages
188
Reaction score
0
Location
127.0.0.1
I'm looking for a script that teleport the player thats clicking on a item.

and another script that Teleports a player when walking on a tile.
 
Teleport when click on item:
Here you are:
Code:
function onUse(cid, item, frompos, item2, topos)

playerposition = {x=711, y=312, z=10}


   if item.uid == UNIQUEID then
      if item.itemid == ITEMID then
         doTeleportThing(cid,playerposition)
         doSendMagicEffect(nplayer1pos,10)
         doSendMagicEffect(topos,6)
         doSendMagicEffect(frompos,6)
      end
   end
   return 1
end
just change the unique id, item id and the position

Tp when walking on item:
Code:
function onStepIn(cid, item, frompos, item2, topos) 

playerpos = getPlayerPosition(cid) 
newpos = {x=748, y=398, z=8} 

	if item.uid == UNIQUEID then
		getThingfromPos(playerpos) 
		doSendMagicEffect(playerpos,2) 
		doTeleportThing(cid,newpos) 
		doSendMagicEffect(newpos,10) 
	end 
end
Here you need to change the position and the unique id
 
@up!

UniqueID cannot be placed to an item that the player takes in his backpack (for example, a small sapphire)

use this:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x=10, y=11, z=7}

if item.itemid == ITEM_ID then

	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	doTeleportThing(cid, pos)
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
	end
end
 
if item.itemid == ITEM_ID then

for what is this?

you don't need to set...cause it will be added at actions.xml

--

heres a version, if player have PZ he'll not abre to use!

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x=10, y=11, z=7}
local inFight = getCreatureCondition(cid, CONDITION_INFIGHT)

    if inFight == FALSE then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doTeleportThing(cid, pos)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    else
        doPlayerSendCancel(cid,"You cannot use this when you\'re in fight!.")
    end
    return TRUE
end
 
Last edited:
Back
Top