Bruce Leal
New Member
- Joined
- Nov 9, 2017
- Messages
- 77
- Reaction score
- 3
This script was made so that only one vocation goes through the door, however I would like 3 or more Vocations to pass.
Code:
function onUse(cid, item, frompos, item2, topos)
local VOCNAME = Knight -- NOME DA VOCAçÃO
local Vocid = 4 -- Id da vocacao
if item.uid == 7070 then
status1 = getPlayerVocation(cid)
if status1 == Vocid 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
doPlayerSendCancel(cid,'Esteja em frente a porta.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao pode passar, pois nao pertence a linhagem dos Knights.")
end
return 1
else
return 0
end
end