Ir para conteúdo
  • Cadastre-se

ERRO EVENTO - TEAM BATTLE


Posts Recomendados

Estou com o seguinte erro quando o evento começa - [Error - CreatureScript Interface]
data/creaturescripts/scripts/events/realTeamBattle.lua:onTarget
Description:
...ta/creaturescripts/scripts/events/realTeamBattle.lua:23: attempt to compare number with string
stack traceback:
        ...ta/creaturescripts/scripts/events/realTeamBattle.lua:23: in function <...ta/creaturescripts/scripts/events/realTeamBattle.lua:20>

Link para o post
Compartilhar em outros sites

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

@antharaz 

9 horas atrás, antharaz disse:

@Piquenuxo 

 

Sem você postar o script não tem como ninguém te ajudar.

Ai amigao - https://pastebin.com/D3KFp2rH

Link para o post
Compartilhar em outros sites

@Piquenuxo 

 

Tenta assim:

 

Spoiler

--[[   
 
            Real Team Battle Event
    Desenvolvido por Vítor Bertolucci (Killua)
 
]]
 
function onCombat(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        local sto = tonumber(getPlayerStorageValue(cid, realTeamBattle.teamStorage))
        if sto > 0 then
            if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
                return false
            end
        end
    end
    return true
end
 
function onTarget(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        local sto = tonumber(getPlayerStorageValue(cid, realTeamBattle.teamStorage))
        if sto > 0 then
            if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
                doPlayerSendCancel(cid,"Você não pode atacar seu companheiro de time.")
                return false
            end
        end
    end
    return true
end
 
function onPrepareDeath(cid, deathList)
    if isPlayer(cid) then
        local sto = tonumber(getPlayerStorageValue(cid,realTeamBattle.teamStorage))
        if sto > 0 then
            local times = {"Red Assassins", "Blue Norsemen", "Black Hunters", "Green Beggars"}
            realTeamBattle.broadcast(MESSAGE_STATUS_CONSOLE_ORANGE,"[Team Battle] O jogador "..getCreatureName(cid).." do time "..times[sto].." foi morto!")
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"[Team Battle] You are dead!")
            realTeamBattle.cleanPlayer(cid)
            realTeamBattle.checkTeams()
        end
    end
    return true
end
 
function onLogin(cid)
    doPlayerSetStorageValue(cid, realTeamBattle.teamStorage,-1)
    registerCreatureEvent(cid, "realTeamBattleDeath")
    registerCreatureEvent(cid, "realTeamBattleCombat")
    registerCreatureEvent(cid, "realTeamBattleTarget")
    return true
end

 

 

Link para o post
Compartilhar em outros sites

@antharaz 

1 hora atrás, antharaz disse:

@Piquenuxo 

 

Tenta assim:

 

  Mostrar conteúdo oculto


--[[   
 
            Real Team Battle Event
    Desenvolvido por Vítor Bertolucci (Killua)
 
]]
 
function onCombat(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        local sto = tonumber(getPlayerStorageValue(cid, realTeamBattle.teamStorage))
        if sto > 0 then
            if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
                return false
            end
        end
    end
    return true
end
 
function onTarget(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        local sto = tonumber(getPlayerStorageValue(cid, realTeamBattle.teamStorage))
        if sto > 0 then
            if sto == getPlayerStorageValue(target, realTeamBattle.teamStorage) then
                doPlayerSendCancel(cid,"Você não pode atacar seu companheiro de time.")
                return false
            end
        end
    end
    return true
end
 
function onPrepareDeath(cid, deathList)
    if isPlayer(cid) then
        local sto = tonumber(getPlayerStorageValue(cid,realTeamBattle.teamStorage))
        if sto > 0 then
            local times = {"Red Assassins", "Blue Norsemen", "Black Hunters", "Green Beggars"}
            realTeamBattle.broadcast(MESSAGE_STATUS_CONSOLE_ORANGE,"[Team Battle] O jogador "..getCreatureName(cid).." do time "..times[sto].." foi morto!")
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"[Team Battle] You are dead!")
            realTeamBattle.cleanPlayer(cid)
            realTeamBattle.checkTeams()
        end
    end
    return true
end
 
function onLogin(cid)
    doPlayerSetStorageValue(cid, realTeamBattle.teamStorage,-1)
    registerCreatureEvent(cid, "realTeamBattleDeath")
    registerCreatureEvent(cid, "realTeamBattleCombat")
    registerCreatureEvent(cid, "realTeamBattleTarget")
    return true
end

 

 

Funciono, obrigado!!!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo