Ir para conteúdo
  • Cadastre-se

(Resolvido)Porta com level


Ir para solução Resolvido por Movie,

Posts Recomendados

  • Solução

Em actions:

local level = 450000

function onUse(cid, fromPos, toPos)
    return getPlayerLevel(cid) >= level and doTeleportThing(cid, toPos) or doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only players level '..level..' or higher can open this door.') and false
end

Para configurar é assim:

 

em data/actions/actions.xml coloque:

 

<action actionid="9999" event="script" value="portalevel.lua"/>

 

No lugar de 9999 coloque uma actionid, que será o número colocado no RME na porta.

 

Crie um novo arquivo .lua em data/actions/script/portalevel.lua com o seguinte script:

local level = 450000

function onUse(cid, fromPos, toPos)
    return getPlayerLevel(cid) >= level and doTeleportThing(cid, toPos) or doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only players level '..level..' or higher can open this door.') and false
end

Pronto :)

Link para o post
Compartilhar em outros sites
  • 4 weeks later...
  • Respostas 8
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Se não me engano a partir do level 999 apenas por script isso é possivel.

Em actions: local level = 450000 function onUse(cid, fromPos, toPos)     return getPlayerLevel(cid) >= level and doTeleportThing(cid, toPos) or doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only players level '..level..' or higher can open this door.') and false end Para configurar é assim:   em data/actions/actions.xml coloque:   <action actionid="9999" event="script" value="portalevel.lua"/>   No lugar de 9999 coloque uma actionid, que será o número colocado no RME na po

<action uniqueid="10093" script="vocdoor_druid.lua" /> function onUse(cid, item, frompos, item2, topos) if item.uid == 10093 then if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then doPlayerSendTextMessage(cid, 22, "You can pass, you are a Druid.") 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

como coloca porta com vocação??

<action uniqueid="10093" script="vocdoor_druid.lua" />
function onUse(cid, item, frompos, item2, topos)

if item.uid == 10093 then
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Druid.")
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,'Please stand in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Druid.')
end
return 1
else
return 0
end
end
Editado por Larissa Azhaurn (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

como coloca porta com vocação??


local pos = {x=995, y=1000, z=9} -- posicao aonde o player sera teletransportado
local position = getCreaturePosition(cid)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.actionID== 1228) then
        if getplayervocation(cid) == 1 or getplayervocation(cid) == 5 then
            doTeleportThing(cid, pos)
            doSendMagicEffect(position, math.random(1, 67)
        else
            doPlayerSendTextMessage(cid, 22, "APENAS VOCATION X PASSA AQUI")
        end
        return TRUE
    end
end

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96846
    Tópicos
    519605
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo