carre
Advanced OT User
Hi
I'm working on VOC door on the island of destiny 8.6.


won't close it´self after opening the door.
My vocdoor.lua
I'm working on VOC door on the island of destiny 8.6.



won't close it´self after opening the door.
Post automatically merged:
My vocdoor.lua
Code:
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
doTransformItem(item.uid, 1258)
else
doPlayerSendTextMessage(cid,22,"Only Sorcerer's 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 Druid's 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
doTransformItem(item.uid, 1258)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only Paladin's 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
doTransformItem(item.uid, 1258)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,"Only Knight's can pass.")
end
return 1
else
return 0
end
end