Ir para conteúdo

Featured Replies

  • Respostas 12
  • Visualizações 4.5k
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

  • 1 month later...
Postado

Fala mano beleza? nesse seu script na mensagem de contar os kills e exibir para os players não esta funcionando, você pode me ajudar?

kill = "Voce ja matou {%d} %s do evento.",

 

Os anuncions de quando inicia o evento etc.. esta funcionando, porem quando eu mato os bixos não aparece o contador

Meu server é em RevScripts

 

caso você entenda e possa me ajudar esse é o meu xml

 

Spoiler

 

local monstereventglobal = GlobalEvent("monstereventglobal")

function monstereventglobal.onThink(interval)
    if MONSTER_HUNT.days[os.date("%A")] then
        local hrs = tostring(os.date("%X")):sub(1, 5)
        if isInArray(MONSTER_HUNT.days[os.date("%A")], hrs) then
            MONSTER_HUNT:initEvent()
        end
    end
    return true
end

function onTime(interval)
    MONSTER_HUNT:endEvent()
    return true
end

monstereventglobal:interval(60000) -- will be executed every 1000ms
monstereventglobal:register()

local monstereventcreature = CreatureEvent("MonsterHunt")
function monstereventcreature.onKill(player, target)

    if Game.getStorageValue(MONSTER_HUNT.storages.monster) == nil then
        return true
    end

    if not player or not target then
        return true
    end

    if player:getStorageValue(MONSTER_HUNT.storages.player) == -1 then
        player:setStorageValue(MONSTER_HUNT.storages.player, 0)
    end

    if target:isMonster() and target:getName():lower() == (MONSTER_HUNT.list[Game.getStorageValue(MONSTER_HUNT.storages.monster)]):lower() then
        player:setStorageValue(MONSTER_HUNT.storages.player, player:getStorageValue(MONSTER_HUNT.storages.player) + 1)
        player:sendTextMessage(MESSAGE_STATUS_BLUE_LIGHT, MONSTER_HUNT.messages.prefix .. MONSTER_HUNT.messages.kill:format(player:getStorageValue(MONSTER_HUNT.storages.player), target:getName()))
        table.insert(MONSTER_HUNT.players, {player:getId(), player:getStorageValue(MONSTER_HUNT.storages.player)})
    end

    return true
end

monstereventcreature:type("kill")
monstereventcreature:register()

 

local monstereventcreature = CreatureEvent("MonsterHunt")
function monstereventcreature.onKill(player, target)

    if Game.getStorageValue(MONSTER_HUNT.storages.monster) == nil then
        return true
    end

    if not player or not target then
        return true
    end

    if player:getStorageValue(MONSTER_HUNT.storages.player) == -1 then
        player:setStorageValue(MONSTER_HUNT.storages.player, 0)
    end

    if target:isMonster() and target:getName():lower() == (MONSTER_HUNT.list[Game.getStorageValue(MONSTER_HUNT.storages.monster)]):lower() then
        player:setStorageValue(MONSTER_HUNT.storages.player, player:getStorageValue(MONSTER_HUNT.storages.player) + 1)
        player:sendTextMessage(MESSAGE_STATUS_BLUE_LIGHT, MONSTER_HUNT.messages.prefix .. MONSTER_HUNT.messages.kill:format(player:getStorageValue(MONSTER_HUNT.storages.player), target:getName()))
        table.insert(MONSTER_HUNT.players, {player:getId(), player:getStorageValue(MONSTER_HUNT.storages.player)})
    end

    return true
end

monstereventcreature:type("kill")
monstereventcreature:register()

 

 

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

  • 1 month later...
Postado

Olá. Ao testar aqui, ele inicia o evento, dá as mensagens, sorteia o mob, tudo certo, mas quando eu mato o mob sorteado ele dá debug no client, tem alguma ideia?
Nenhum erro na distro.

Valeu.

  • 2 months later...
Postado

testei e funciona direitinho, estou passando ele para o revscript está tudo certo na hora de receber o prêmio mas dps que o evento é encerrado acontece de que quando eu mato qualquer outra criatura sendo ou não da lista, aparece o seguinte erro:

 

Lua Script Error: [Scripts Interface]
C:\Users\Desktop\NovoUniServer\otserv - Baiak\data\scripts\creaturescripts\monsterHuntKill.lua:callback
...- Baiak\data\scripts\creaturescripts\monsterHuntKill.lua:17: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        ...- Baiak\data\scripts\creaturescripts\monsterHuntKill.lua:17: in function <...- Baiak\data\scripts\creaturescripts\monsterHuntKill.lua:3>

 

 

 

SCRIPT:

 

 

local monsterHunt = CreatureEvent("monsterHunt")

function monsterHunt.onKill(player, target)

    if Game.getStorageValue(MONSTER_HUNT.storages.monster) == nil then
        return true
    end

    if not player or not target then
        return true
    end

    if player:getStorageValue(MONSTER_HUNT.storages.player) == -1 then
        player:setStorageValue(MONSTER_HUNT.storages.player, 0)
    end

    if target:isMonster() and target:getName():lower() == (MONSTER_HUNT.list[Game.getStorageValue(MONSTER_HUNT.storages.monster)]):lower() then
        player:setStorageValue(MONSTER_HUNT.storages.player, player:getStorageValue(MONSTER_HUNT.storages.player) + 1)
        player:sendTextMessage(30, MONSTER_HUNT.messages.prefix .. MONSTER_HUNT.messages.kill:format(player:getStorageValue(MONSTER_HUNT.storages.player), target:getName()))
        table.insert(MONSTER_HUNT.players, {player:getId(), player:getStorageValue(MONSTER_HUNT.storages.player)})
    end
end

monsterHunt:register()
 

 

 

 

conseguem me ajudar?

Editado por ETinhowww
erro (veja o histórico de edições)

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 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo