• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How do i make a door let only some vocations through?

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
I need a door that only lets vocations #
2 10 28 29 30

and then Auto closes after they walk Through. Think anyone can help me out :o?
 
LUA:
local t = {
    voc = {2, 10, 28, 29, 30}
}


function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ID_OF_THE_CLOSED_DOOR then
        if(t.voc and not isInArray(t.voc, getPlayerVocation(cid))) then
            return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have the required vocation.")
        end
 
 
        doTransformItem(item.uid, item.itemid + 1)
        doTeleportThing(cid, toPosition)
        return true
    end
end
 
Last edited:
Try this?
LUA:
local t = {
    voc = {2, 10, 28, 29, 30}
}
*
*
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ID_OF_THE_CLOSED_DOOR then
        if isInArray(t.voc, getPlayerVocation(cid) == FALSE then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have the required vocation.")
            return FALSE
        end
        doTransformItem(item.uid, item.itemid + 1)
        doTeleportThing(cid, toPosition)
        return TRUE
    end
end
 
I've already tested my script and vocation ID's not mentioned cannot pass by the door.
 
Try this?
LUA:
local t = {
    [voc] = {2, 10, 28, 29, 30}
}


function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ID_OF_THE_CLOSED_DOOR then
        if isInArray(t[voc], getPlayerVocation(cid) == FALSE then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have the required vocation.")
            return FALSE
        end
        doTransformItem(item.uid, item.itemid + 1)
        doTeleportThing(cid, toPosition)
        return TRUE
    end
end
 
Back
Top