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

(Actions) Voc Door.xml

xx Kami xx

Retired.
Joined
Dec 29, 2012
Messages
509
Reaction score
20
Hello i need this script to work for druids & sorcerer's
it only works for sorcerer, i need it to work for both

LUA:
local pos = {x = 1049, y = 729, z = 6}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 1 and getPlayerVocation(cid) == 5 then
	    doTeleportThing(cid,pos)
		doSendMagicEffect(getThingPos(cid), math.random(67))
	else
		doCreatureSay(cid, 'Only sorcerers can pass this door', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end

will Rep++
 
Last edited:
Well it says "Only sorcerers can pass this door", even though changing it still won't allow Druids into it, change it too "Only Sorcerers and Druids can pass through this door".

I'm no pro scripter, but I'd imagine it'd be something like

Code:
local pos = {x = 1049, y = 729, z = 6}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 1 and getPlayerVocation(cid) == 5 and getPlayerVocation(cid) == 6 then
	    doTeleportThing(cid,pos)
		doSendMagicEffect(getThingPos(cid), math.random(67))
	else
		doCreatureSay(cid, 'Only Sorcerers and Druids can pass through the door', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end

If this was wrong, can someone explain what I did wrong?
 
Well it says "Only sorcerers can pass this door", even though changing it still won't allow Druids into it, change it too "Only Sorcerers and Druids can pass through this door".

I'm no pro scripter, but I'd imagine it'd be something like

Code:
local pos = {x = 1049, y = 729, z = 6}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 1 and getPlayerVocation(cid) == 5 and getPlayerVocation(cid) == 6 then
	    doTeleportThing(cid,pos)
		doSendMagicEffect(getThingPos(cid), math.random(67))
	else
		doCreatureSay(cid, 'Only Sorcerers and Druids can pass through the door', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end

If this was wrong, can someone explain what I did wrong?

i dont think this will work x.x
 
Use or instead of and while checking for the voc, although you can also use:
LUA:
if isInArray({1, 2, 5, 6}, getPlayerVocation(cid)) then
 
Could u possible let me get the full file cause i'm trying to do the same thing.

Also you could try just putting 2 different codes

local pos = {x = 1049, y = 729, z = 6}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) == 1 and getPlayerVocation(cid) == 5 then
doTeleportThing(cid,pos)
doSendMagicEffect(getThingPos(cid), math.random(67))
else
doCreatureSay(cid, 'Only sorcerers can pass this door', TALKTYPE_ORANGE_1, false, cid)
end
return true
end

local pos = {x = 1049, y = 729, z = 6}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) == 2 and getPlayerVocation(cid) == 6 then
doTeleportThing(cid,pos)
doSendMagicEffect(getThingPos(cid), math.random(67))
else
doCreatureSay(cid, 'Only druids can pass this door', TALKTYPE_ORANGE_1, false, cid)
end
return true
end

I would believe this would work perfect
 
Use
LUA:
if isInArray({1, 2, 5, 6}, getPlayerVocation(cid)) then
instead of
LUA:
if getPlayerVocation(cid) == 1 and getPlayerVocation(cid) == 5 then
 
LUA:
local pos = {x = 1049, y = 729, z = 6}
local t = {1, 2, 5, 6}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, #t do
    if getPlayerVocation(cid,i) then
	    doTeleportThing(cid,pos)
		doSendMagicEffect(getThingPos(cid), math.random(67))
	else
		doCreatureSay(cid, 'Only sorcerers can pass this door', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end
 
Back
Top