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

Solved Expertise door

skifft92

New Member
Joined
May 26, 2011
Messages
29
Reaction score
0
I want a door to work for a certain vocation that is a certain level and I only know how to do the both of them separately, please help :)
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local coords = {x = 1000, y = 1000, z = 1111111}
local requiredlevel = 10

return isInArray({1, 2, 3, 4, 5, 6, 7, 8}, getPlayerVocation(cid)) and getPlayerLevel(cid) >= requiredlevel and doTeleportThing(cid, coords, TRUE) or doPlayerSendCancel(cid, "Sorry not posible.")
end

put in Array({1,2,3,4,5,6,7,8} the vocations you want to enter example 1 Sorc 5 MS
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)    
     if getPlayerLevel(cid) <= 1000 then
         doTransformItem(item.uid, item.itemid + 1)
         doTeleportThing(cid, toPosition)
     else
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 1000 or lower.")
     end
     return true
end

Or if added to an other script:
Code:
if getPlayerLevel(cid) > 1000 then
     return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 1000 or lower.")
end
 
Back
Top