• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

use item on actionid and get teleported

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Helllo otlanders , i want to request an script would be nice if someone could make it ;)

So if i use itemid 9999 on actionid 8888 , i get teleported to x/y/z with a message 'hello master'
and if a player trys to use any other items on actionid 8888 they get message 'you need special item to use'
aswell if player steps on 8888 actionid he gets POF magic effect and recieves messge aswell 'you need to use item on it'

i use 0.4
 
Will update this post in 30 min or less.

actionscript
Code:
<action actionid="8888" event="script" value="script.lua"/>
Code:
local teleport_position = {x = 1000, y = 1000, z = 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
     if itemEx.itemid ~= 9999 then
         doPlayerSendCancel(cid, "Requires special item.")
         doSendMagicEffect(toPosition, CONST_ME_POFF)
         return true
     end
     doTeleportThing(cid, teleport_position)
     doCreatureSay(cid, "Hello\nMaster", TALKTYPE_ORANGE_1, cid)
     return true
end
movement script
Code:
<movevent type="StepIn" actionid="8888" event="script" value="script.lua"/>
Code:
function onStepIn(cid, item, position, fromPosition)
     if not isPlayer(cid) then
         return true
     end
     doPlayerSendCancel(cid, "Requires special item.")
     doSendMagicEffect(position, CONST_ME_POFF)
     doTeleportThing(cid, fromPosition)
     return true
end
 
Last edited by a moderator:
Back
Top