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

[SCRIPT] When vocation set - you can use teleport.

Blue Identity

Member
Joined
Feb 20, 2009
Messages
174
Reaction score
15
Location
Netherlands
Hello smarter people than me.

I'm trying to make a new island that you need to get yourself a vocation first. This can be gotten from the NPC but there comes another part.

When you got the vocation I want people to be able to use a train ( ID 7131 ) as a teleport to the main city and direclty sets the people there temple pos there aswel.

So for example...

if vocation 1,2,3,4 than - use teleport train - gets teleported to main temple x,y,z, - sets temple pos x,y,z,

Please help me on this one..

Thanks already!
 
Movement

OnStepIn

if getplayervocation(cid) >= 1 and getplayervocation(cid) <= 4 then
newpos = {x=666, y=666, z=7}
doteleportthing(cid, newpos)
dosendmagiceffect(newpos, 10)
end


something like that

try to figure it out =)
 
LUA:
function onStepIn (cid, fromposition)

local pos = {x=1000, y=1000, z=7}

if isInArray({4,8}, getPlayerVocation(cid)) then
doTeleportThing(cid,pos)
doSendMagicEffect(pos,12) 
doPlayerSendTextMessage(cid,22,"You have teleported")
else
doPlayerSendTextMessage(cid,22,"You don't are Druid or Elder Druid you can't pass")
   end
end
 
@ Up, the words above are misspelled and are too big to send. Try this :)

LUA:
function onStepIn (cid, fromposition)
 
local pos = {x=1000, y=1000, z=7}
 
if isInArray({4,8}, getPlayerVocation(cid)) then
doTeleportThing(cid,pos)
doSendMagicEffect(pos,12) 
doPlayerSendTextMessage(cid,22,"Warped!")
else
doPlayerSendTextMessage(cid,22,"You are an Elder Druid you may not pass.")
   end
end
 
there's not need to use town pos, with the id of town is enough:
LUA:
local newTown = 3 --id of new town

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if isPlayer(cid) and isInArray({1,2,3,4}, getPlayerVocation(cid)) then
        doPlayerSetTown(cid, newTown)
        doTeleportThing(cid, getTownTemplePosition(newTown))
        doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Warped!')
    else
        doTeleportThing(cid, fromPosition)
        doPlayerSendCancel(cid, 'You are not allowed to go with your current vocation.')
    end
    return true
end
 
Back
Top