Ir para conteúdo

nelsonjrs

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Obrigado
    nelsonjrs deu reputação a So volto tarde em Action para LVL   
    function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { min_lvl = 10, max_lxl = 20 } if (getPlayerLevel(cid) < config.min_lvl or getPlayerLevel(cid) > config.max_lxl) then doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "u dont have lvl/have too much lvl") end return true end  
  2. Curtir
    nelsonjrs deu reputação a MatteusDeli em Ajuda Script teleporte   
    @nelsonjrs Boa tarde, veja se é isso que você quer, a configuração de como usar o script está comentada.
    Obs: Lembre-se de adicionar a actionId em todos os teleportes.
     
    Crie um arquivo chamando room.lua em movements/scripts e adicione este código nele:
    -- Quantidade de level que o player irá ganhar local LEVEL_AMOUNT = 1 -- Defina a posição do teleport no final da sala, defina um valor único para o storage, assim o player irá ganhar o level apenas uma vez local teleportPositions = { { position = { x=151,y=55,z=7 }, storage = 14521 }, { position = { x=158,y=58,z=7 }, storage = 14522 }, { position = { x=151,y=54,z=7 }, storage = 14523 }, { position = { x=156,y=58,z=7 }, storage = 14524 }, } function onStepIn(cid, item, position, fromPosition) local playerPosition = getThingPos(cid) for _,teleportPosition in ipairs(teleportPositions) do if (checkPlayerPosition(teleportPosition.position, playerPosition)) then playerAddLevel(cid, teleportPosition.storage) end end return true end function checkPlayerPosition(teleportPosition, playerPosition) if (teleportPosition.x == playerPosition.x and teleportPosition.y == playerPosition.y and teleportPosition.z == playerPosition.z) then return true end end function playerAddLevel(player, storage) if (getPlayerStorageValue(player, storage) > 0) then return false end local playerLevel = getPlayerLevel(player) + LEVEL_AMOUNT local playerCalculateExperienceNextLevel = (getExperienceForLevel(playerLevel) - getPlayerExperience(player)) doPlayerAddExperience(player, playerCalculateExperienceNextLevel) setPlayerStorageValue(player, storage, 1) end  
    Vá em movements.xml e adicione está linha nele:
    <movevent type="StepIn" actionid="3333" event="script" value="room.lua"/>  

Informação Importante

Confirmação de Termo