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

MoveEvent Teleport for a certain vocation only!

ghettobird

LUA newbie
Joined
Aug 17, 2013
Messages
679
Reaction score
132
Location
OTland
Hiho OTlanders, so I had some free time and decided to make a simple script that only allows a certain vocation to pass through the teleport...


So how will it work?
You will have to set a unique id for the teleport from rme (which you will put in movements.xml), now it will check for the player's vocation id, if his vocation id is 6 for example (Elder Druid) then he will be teleported to a certain place...

Maybe you would like to use this for a real map or something...

If you would like me to make any changes in the script please just psot here and ill do it :)

so now go to movements/scripts
Code:
 function onStepIn(cid, item, position, fromPosition)
ifgetPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are an Elder Druid, you can pass (: !")
else
doPlayerSendCancel(cid, "Only Elder Druids can pass from this teleport.")
end
doTeleportThing(cid, {x=994,y=1003,z=7}, true)
return true
end


now you just make the unique id and put it in movements.xml...

I won't spoon feed you the script so you only need the knowledge of copying another movements.xml with a unique id & just put the unique id u put in rme... ;)
 
Hiho OTlanders, so I had some free time and decided to make a simple script that only allows a certain vocation to pass through the teleport...


So how will it work?
You will have to set a unique id for the teleport from rme (which you will put in movements.xml), now it will check for the player's vocation id, if his vocation id is 6 for example (Elder Druid) then he will be teleported to a certain place...

Maybe you would like to use this for a real map or something...

If you would like me to make any changes in the script please just psot here and ill do it :)

so now go to movements/scripts
Code:
 function onStepIn(cid, item, position, fromPosition)
ifgetPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are an Elder Druid, you can pass (: !")
else
doPlayerSendCancel(cid, "Only Elder Druids can pass from this teleport.")
end
doTeleportThing(cid, {x=994,y=1003,z=7}, true)
return true
end


now you just make the unique id and put it in movements.xml...

I won't spoon feed you the script so you only need the knowledge of copying another movements.xml with a unique id & just put the unique id u put in rme... ;)
[18/12/2014 01:24:55] [Error - LuaScriptInterface::loadFile] data/movements/scripts/specialtp.lua:2: unexpected symbol near '=='
[18/12/2014 01:24:55] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/specialtp.lua)
[18/12/2014 01:24:55] data/movements/scripts/specialtp.lua:2: unexpected symbol near '=='
version 0.3.6
 
Last edited:
[18/12/2014 01:24:55] [Error - LuaScriptInterface::loadFile] data/movements/scripts/specialtp.lua:2: unexpected symbol near '=='
[18/12/2014 01:24:55] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/specialtp.lua)
[18/12/2014 01:24:55] data/movements/scripts/specialtp.lua:2: unexpected symbol near '=='
version 0.3.6
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are an Elder Druid, you can pass :) !")
else
doPlayerSendCancel(cid, "Only Elder Druids can pass from this teleport.")
end
doTeleportThing(cid, {x=994,y=1003,z=7}, true)
return true
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are an Elder Druid, you can pass :) !")
else
doPlayerSendCancel(cid, "Only Elder Druids can pass from this teleport.")
end
doTeleportThing(cid, {x=994,y=1003,z=7}, true)
return true
end
mmmm made it and didnt give me any error but any voc can enter this tp
 
u can try this
Code:
function onStepIn(cid, item, frompos, item2, topos)

local vocations = {1,2} -- Add VocId, Which vocations can enter!
local nvtp = {x=1000, y=1000, z=7}  ---- where tp back you if not allowed tp
local vtp = {x=1001, y=1001, z=7}     ---- where tp you 

if not(isPlayer(cid)) then return true end
if isInArray(vocations,getPlayerVocation(cid)) then
doCreatureSay(cid, "Welcome!", TALKTYPE_ORANGE_1)
doTeleportThing(cid, vtp, TRUE)
else
doCreatureSay(cid, "Only Epic's are allowed to enter.", TALKTYPE_ORANGE_1)
doTeleportThing(cid, nvtp, FALSE)
end
end
 
u can try this
Code:
function onStepIn(cid, item, frompos, item2, topos)

local vocations = {1,2} -- Add VocId, Which vocations can enter!
local nvtp = {x=1000, y=1000, z=7}  ---- where tp back you if not allowed tp
local vtp = {x=1001, y=1001, z=7}     ---- where tp you

if not(isPlayer(cid)) then return true end
if isInArray(vocations,getPlayerVocation(cid)) then
doCreatureSay(cid, "Welcome!", TALKTYPE_ORANGE_1)
doTeleportThing(cid, vtp, TRUE)
else
doCreatureSay(cid, "Only Epic's are allowed to enter.", TALKTYPE_ORANGE_1)
doTeleportThing(cid, nvtp, FALSE)
end
end
thx working but can you make this positions to make player stay on his place if he isn't the correct voc?

local nvtp = {x=1000, y=1000, z=7} ---- where tp back you if not allowed tp
 
Back
Top