Ir para conteúdo

Featured Replies

Postado
  • Autor

Quando vou dar use na alavanca diz

 

You cannot use this object

 

e no servidor da esse erro

 

Lua Script Error: [Action Interface]
data/actions/scripts/hallsofhope/lever.lua:onUse
data/actions/scripts/hallsofhope/lever.lua:27: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/hallsofhope/lever.lua:27: in function <data/actions/scripts/hallsofhope/lever.lua:23>
 

  • Respostas 13
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • FlavioHulk
    FlavioHulk

    local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14),

Postado
local config = {
    requiredLevel = 100,
    daily = false,
    playerPositions = {
        Position(33010, 31660, 14),
        Position(33010, 31661, 14),
        Position(33010, 31662, 14),
        Position(33010, 31663, 14),
        Position(33010, 31664, 14)
    },
    newPositions = {
        Position(32974, 31670, 14),
        Position(32975, 31670, 14),
        Position(32976, 31670, 14),
        Position(32977, 31670, 14),
        Position(32978, 31670, 14)
    },
    BossPositions = {
        Position(32977, 31658, 14)
    }
}
local hours, storage = 24, 574984
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 playerTile and not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "summon? u are noob?")
                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
            if playerTile:getStorageValue(storage) >= os.time() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "The chest is empty, come back tomorrow for a new reward.")
                return true
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
        for i = 1, #config.BossPositions do
            Game.createMonster("The Time Guardian", config.BossPositions)
        end
        local players
        for i = 1, #storePlayers do
            players = storePlayers
            config.playerPositions:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions)
	    players:setStorageValue(storage, os.time()+hours*3600)
            config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
        end
    elseif item.itemid == 1945 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

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

Lua Script Error: [Action Interface]
data/actions/scripts/hallsofhope/lever.lua:onUse
data/actions/scripts/hallsofhope/lever.lua:27: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/hallsofhope/lever.lua:27: in function <data/actions/scripts/hallsofhope/lever.lua:23>
 

 

:(

Postado
  • Solução

CLARO CARA VOCÊ NÃO POSTOU SEU CÓDIGO EM BB CODE, AI QUANDO VOCÊ JOGOU DESSE JEITO O 

 

[i]

some , porque o forum buga o codigo e entende como ITALICO

 

 

 

 

--------------------

local config = {
    requiredLevel = 100,
    daily = false,
    playerPositions = {
        Position(33010, 31660, 14),
        Position(33010, 31661, 14),
        Position(33010, 31662, 14),
        Position(33010, 31663, 14),
        Position(33010, 31664, 14)
    },
    newPositions = {
        Position(32974, 31670, 14),
        Position(32975, 31670, 14),
        Position(32976, 31670, 14),
        Position(32977, 31670, 14),
        Position(32978, 31670, 14)
    },
    BossPositions = {
        Position(32977, 31658, 14)
    }
}
local check, hours, storage = true, 24, 574984
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[i]):getTopCreature()
            if playerTile and not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "summon? u are noob?")
                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
            if check and playerTile:getStorageValue(storage) - os.time() > 0  then
                player:sendCancelMessage("The chest is empty, come back tomorrow for a new reward.")
                return true
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
        for i = 1, #config.BossPositions do
            Game.createMonster("The Time Guardian", config.BossPositions[i])
        end
        local players
        for i = 1, #storePlayers do
            players = storePlayers[i]
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
      	    players:setStorageValue(storage, os.time()+hours*3600)
        end
    elseif item.itemid == 1945 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

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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.7k

Informação Importante

Confirmação de Termo