• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Vocation Teleport

Barbyn

Founder of Granaria 09/10
Joined
Jun 13, 2007
Messages
167
Reaction score
1
Add this in /data/movements/movements.xml.
Lua:
 <movevent type="StepIn" uniqueid="XXXXX" event="script" value="vocationteleport.lua"/>
Add this in /data/movements/vocationteleport.lua.
Lua:
function onStepIn(cid, item, frompos, item2, topos)

    local vocation = getPlayerVocation(cid)
    local nvtp = {x=1000, y=1000, z=7}
    local vtp = {x=1001, y=1001, z=7}


    if vocation == 7 then
        doCreatureSay(cid, "TEXT GOES HERE. If player is vocation 7.", TALKTYPE_ORANGE_1)
		doTeleportThing(cid, vtp, TRUE)
    else
        doCreatureSay(cid, "TEXT GOES HERE. If player is not vocation 7.", TALKTYPE_ORANGE_1)
                doTeleportThing(cid, nvtp, FALSE)
    end
end
This is a vocation teleport, meaning that only a certain vocation can teleport.

The teleport (Item ID: 1387) should have unique id XXXXX.

nvtp (not vocation teleport)= If player isn't vocation 7 then he will not be teleported to chosen area (vtp). Instead he will be teleported to another area (nvtp).
vtp (vocation teleport)= If player is vocation 7 he will be teleported to chosen area (vtp).

Kindest Regards,
Barbyn
 
Back
Top