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

Lua Door Vocation and !leavehouse

kariio96

New Member
Joined
Aug 25, 2010
Messages
28
Reaction score
0
Hello, how to make door vocation ?
And second question is my command !leavehouse - doesn't work ;/
When player write this command in house he get msg : "Player is not online" <- something like that ;/
 
Hello, how to make door vocation ?
And second question is my command !leavehouse - doesn't work ;/
When player write this command in house he get msg : "Player is not online" <- something like that ;/

IIRC, you have to be standing outside of the house, facing the front door to use !leavehouse, then it allows you to trade the deed in a safe trade window with someone standing nearby.
 
This is how you add a vocation door

In the mapeditor:
- Place magic door(expertise door)
- Set actionID as 100 + vocation ID. (eg. knight = 104)
 
door vocation:
LUA:
function onUse(cid, item, frompos, item2, topos)
playervoc = getPlayerVocation(cid)


if item.actionid == (4531) then
if getPlayerVocation(cid) == 1 or playervoc == 5 then


pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only sorcerer can pass.")
end

elseif item.actionid == (4532) then
if getPlayerVocation(cid) == 2 or playervoc == 6 then


pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only druids can pass.")
end

elseif item.actionid == (4533) then
if getPlayerVocation(cid) == 3 or playervoc == 7 then
pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only paladins can pass.")
end

elseif item.actionid == (4534) then
if getPlayerVocation(cid) == 4 or playervoc == 8 then
pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only knights can pass.")
end
return 1
else
return 0
end
end
 
Back
Top