Ir para conteúdo

Featured Replies

Postado

Olá Tk's,

 

Estou precisando de uma script da seguinte forma:

 

Tenho uma Door (porta) de gate "level", que eu preciso limitar o level para entrar por exemplo Só ate level 20 pode acessar.

 

Base: Yurots 0.9.4f

 

Se alguém disponível pra me ajudar, ou querer me ensinar agradeço!

 

@FearWar

Postado
  • Autor
6 horas atrás, Mirkaan disse:

Dar level a porta é simples.

 

Action id 1001 = level 1
Action id 1020 = level 20.

E por ai vai.

 

Agora p/ limitar o acesso a leveis 20- terias que criar uma movement.

 

Já consegui, obrigado por tentar ajudar!

Postado

Em actions.xml adicione.

 

<action actionid="120;121" event="script" value="porta.lua"/>

 

Crie um arquivo porta.lua em actions/scripts e adicione.

 

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
local doorPos = {x=getThingPosition(item.uid).x, y=getThingPosition(item.uid).y, z=getThingPosition(item.uid).z}
local playerPos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
local Level = 20
local Premium = FALSE -- Se precisa ser premium para passar na porta
local CannotPass = "Apenas os dignos de Level "..Level.." podem passar por essa porta." --Mensagem que irá surgir se o player não for Level maior que o determinado

-----------------------------------------------------------------------------------------------------------------------------------------------------Portas Oeste ou Leste <->
if item.actionid == 120 and playerPos.x > doorPos.x and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x-1, y= doorPos.y, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
elseif item.actionid == 120 and playerPos.x < doorPos.x and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x+1, y= doorPos.y, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
-----------------------------------------------------------------------------------------------------------------------------------------------------Portas Norte ou Sul ^-\/ 
elseif item.actionid == 121 and playerPos.y > doorPos.y and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x, y= doorPos.y-1, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
elseif item.actionid == 121 and playerPos.y < doorPos.y and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x, y= doorPos.y+1, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)


elseif item.actionid == 120 then
doPlayerSendTextMessage(cid, 25, CannotPass)
elseif item.actionid == 121 then
doPlayerSendTextMessage(cid, 25, CannotPass)
end		
return TRUE
end

 

 

Postado
  • Autor
4 horas atrás, Roy disse:

Em actions.xml adicione.

 


<action actionid="120;121" event="script" value="porta.lua"/>

 

Crie um arquivo porta.lua em actions/scripts e adicione.

 

  Ocultar conteúdo


function onUse(cid, item, fromPosition, itemEx, toPosition)
local doorPos = {x=getThingPosition(item.uid).x, y=getThingPosition(item.uid).y, z=getThingPosition(item.uid).z}
local playerPos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
local Level = 20
local Premium = FALSE -- Se precisa ser premium para passar na porta
local CannotPass = "Apenas os dignos de Level "..Level.." podem passar por essa porta." --Mensagem que irá surgir se o player não for Level maior que o determinado

-----------------------------------------------------------------------------------------------------------------------------------------------------Portas Oeste ou Leste <->
if item.actionid == 120 and playerPos.x > doorPos.x and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x-1, y= doorPos.y, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
elseif item.actionid == 120 and playerPos.x < doorPos.x and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x+1, y= doorPos.y, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
-----------------------------------------------------------------------------------------------------------------------------------------------------Portas Norte ou Sul ^-\/ 
elseif item.actionid == 121 and playerPos.y > doorPos.y and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x, y= doorPos.y-1, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)
elseif item.actionid == 121 and playerPos.y < doorPos.y and getPlayerLevel(cid) < Level and isPremium(cid) == Premium then
doTeleportThing(cid, {x= doorPos.x, y= doorPos.y+1, z= doorPos.z})
doSendMagicEffect(getPlayerPosition(cid), 12)


elseif item.actionid == 120 then
doPlayerSendTextMessage(cid, 25, CannotPass)
elseif item.actionid == 121 then
doPlayerSendTextMessage(cid, 25, CannotPass)
end		
return TRUE
end

 

 

 

function onUse(cid, item, frompos, item2, topos)
local reqLevel = 20
 
 
    if getPlayerLevel(cid) <= reqLevel 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,'Stand in front of the door.')
                return 1
            end
 
            doTeleportThing(cid, pos)
            doSendMagicEffect(topos, 12)
        else
            doPlayerSendTextMessage(cid,22,'Only levels under ' .. reqLevel .. ' can pass this door.')
        end
    return true
end

 

Obrigado por tentar ajudar @Roy

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo