• 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!

Lua Item/talkaction that teleports player to x,y,z

Guapoke

Member
Joined
Nov 21, 2008
Messages
259
Reaction score
5
Anyone could help me with a action or talkaction (if action, item delete himself at use, if talkaction remove certain ammount of gold from player) that teleports player to temple or a certain x,y,z. I know that is no big deal, but the problem I want it to be avaiable only when player is not pz locked, and I don't know how to do it.
I've searched forums but haven't found anything similar to it. I'm old here, just started again and I kind of lost with all these new functions, I know a bit of programming logic so anything would help me. Thanks guys!
 
Code:
local tp = {x=xxx, y=xxx, z=x}
local level = 25

function onUse(cid, item, frompos, item2, topos)
if hasCondition(cid, CONDITION_INFIGHT) then
    doPlayerSendCancel(cid, "You Can't Teleport In Fight")
    return false
    end
 
    if getPlayerLevel(cid) >= level then
        doTeleportThing(cid, tp, true)
        doSendMagicEffect(tp,math.random(5,15))
        doSendAnimatedText(tp, "Welcome", COLOR_RED)
        doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid, "Sorry, your level must higher than 25!")
    end
return true
end

Code:
<action itemid="6119" event="script" script="TPScroll.lua"/>

Add My Skype For more Help:Evronium Fellow
 
Code:
local tp = {x=xxx, y=xxx, z=x}
local level = 25

function onUse(cid, item, frompos, item2, topos)
if hasCondition(cid, CONDITION_INFIGHT) then
    doPlayerSendCancel(cid, "You Can't Teleport In Fight")
    return false
    end

    if getPlayerLevel(cid) >= level then
        doTeleportThing(cid, tp, true)
        doSendMagicEffect(tp,math.random(5,15))
        doSendAnimatedText(tp, "Welcome", COLOR_RED)
        doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid, "Sorry, your level must higher than 25!")
    end
return true
end

Code:
<action itemid="6119" event="script" script="TPScroll.lua"/>

Add My Skype For more Help:Evronium Fellow

Woa that was fast, I will test it right now, thanks mate, I'll add you for sure on skype!
 
Back
Top