Ir para conteúdo

Featured Replies

Postado

Bom fiz um script como da anihi só editei umas coisas etc.. mais ta dando erro

ERROS SÃO ESSES AO PUXAR LAVANCA:

function onUse(player, item, fromPosition, target, toPosition, isHotkey)

Game.createMonster("Demon", config.DemonPositions)

 

 

SCRIPT é esse:

 

Data/actions/quest/scripts/lever.lua

Spoiler

local config = {
    requiredLevel = 350,
    daily = false,
    centerOrshabaalRoomPosition = Position(937, 896, 8),
    playerPositions = {
             Position(931, 896, 7),
         Position(932, 896, 7),
         Position(933, 896, 7),
         Position(934, 896, 7),
             Position(935, 896, 7)
     },
    newPositions = {
        Position(931, 896, 8),
        Position(932, 896, 8),
        Position(933, 896, 8),
        Position(934, 896, 8),
        Position(935, 896, 8)
    },
    OrshabaalPositions = {
        Position(931, 894, 8),
        Position(933, 894, 8),
        Position(935, 894, 8),
        Position(929, 896, 8),
                Position(933, 898, 8),
                Position(934, 898, 8),
        Position(935, 898, 8)
    }
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1946 then
        local storePlayers, playerTile = {}

        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions):getTopCreature()
            if not playerTile or not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
                return true
            end

            if playerTile:getLevel() < config.requiredLevel then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
                return true
            end

            storePlayers[#storePlayers + 1] = playerTile
        end

        local specs, spec = Game.getSpectators(config.centerOrshabaalRoomPosition, false, false, 3, 3, 2, 2)
        for i = 1, #specs do
            spec = specs
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.")
                return true
            end

            spec:remove()
        end

        for i = 1, #config.orshabaalPositions do
            Game.createMonster("Orshabaal", config.DemonPositions)
        end

        local players
        for i = 1, #storePlayers do
            players = storePlayers
            config.playerPositions:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions)
            config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
        end
    elseif item.itemid == 1946 then
        if config.daily then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return true
        end
    end

    item:transform(item.itemid == 1946 and 1945 or 1946)
    return true
end

e em actions xml

adicionei isto

Spoiler

<!-- Solera Quest -->
    <action uniqueid="44444" script="quests/soleraquest/lever.lua" />

Esse uniqueID coloquei tmb na alavanca que os players ira puxar para ir aos orsha

Editado por lango rullez (veja o histórico de edições)

  • Respostas 6
  • Visualizações 942
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Queria saber se as locações estão certas... 

Queria saber qual uniqueID coloco na alavanca.. tmb qual lavanca eu coloco a com o ID:1495 OU 1496

Editado por lango rullez (veja o histórico de edições)

Postado

>> Queria saber se as locações estão certas... 

Isso é com você vendo no mapa.

 

>> Queria saber qual uniqueID coloco na alavanca..

>>>      <action uniqueid="44444"

 

>> qual lavanca eu coloco a com o ID:1495 OU 1496

>>>      if item.itemid == 1946 then

 

Só ler o code :p

 

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.

Estatísticas dos Fóruns

  • Tópicos 96k
  • Posts 512.6k

Informação Importante

Confirmação de Termo