Postado Dezembro 21, 2017 7 anos Olá, tenho o script aqui, mas somente uma vocação pode passar na porta. function onUse(cid, item, frompos, item2, topos) local VOCNAME = Knight -- NOME DA VOC local Vocid = 4 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
Postado Dezembro 22, 2017 7 anos Testa ai Spoiler function onUse(cid, item, frompos, item2, topos) local Vocname1 = 'Knight' -- Nome da primeira vocação local Vocname2 = 'Sorcerer' -- Nome da segunda vocação local Vocid1 = 4 -- ID da primeira vocação local vocid2 = 3 -- ID da segunda vocação if item.uid == 7070 then status1 = getPlayerVocation(cid) if status1 == Vocid1 or status1 == vocid2 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 e um " .. Vocname1 .. " ou " .. Vocname2 .. ".") end return 1 else return 0 end end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.