Ir para conteúdo
  • Cadastre-se

(Resolvido)Alguém ajuda a ajeitar essa script :(


Ir para solução Resolvido por Snowsz,

Posts Recomendados

Galera estou mudando meu ot para otx , só que na transferencia o unico bug que está ocorrendo é essa script, Alguém ajuda aí ? Segue a foto a baixo \/ 

Sem título.png

 

Script 

 

local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?

    killStorageValue = 3943,
    deathStorageValue = 3944,

    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 5953,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },

    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },


    killerAnimation = {
        use = false,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 1
    },

    targetAnimation = {
        use = false,
        text = "OWNED!!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}

function onDeath(cid, corpse, deathList)
    for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
        local killer = deathList
        if(isPlayer(killer) == TRUE) then
                if getPlayerIp(cid) == getPlayerIp(killer) then
                        return true
    end
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
        
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
        
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)

            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel

            local values = {
                ["KILLERKILLS"]         = killerKills,
                ["KILLERDEATHS"]        = killerDeaths,
                ["KILLERNAME"]          = getCreatureName(killer),
                ["KILLERLEVEL"]         = killerLevel,
            
                ["TARGETKILLS"]         = targetKills,
                ["TARGETDEATHS"]        = targetDeaths,
                ["TARGETNAME"]          = getCreatureName(cid),
                ["TARGETLEVEL"]         = targetLevel
            }

            function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
        
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end

            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end

    return true
end
 

 

 

 

Quem poder ajudar vou agradecer :p 

Editado por helix758 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Testa esse 

local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 5953,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    broadcastMessage = {
        use = true,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
        text = "|KILLERNAME| [|KILLERLEVEL|] Matou |TARGETNAME| [|TARGETLEVEL|]! E Arracou Seu Coracao!",
        messageClass = MESSAGE_STATUS_CONSOLE_ORANGE
    },
    killerAnimation = {
        use = false,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 144
    },
    targetAnimation = {
        use = false,
        text = "OWNED!!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}
function onDeath(cid, corpse, deathList)
    for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
        local killer = deathList
        if(isPlayer(killer) == TRUE) then
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
        
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
        
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel
            local values = {
                ["KILLERKILLS"]         = killerKills,
                ["KILLERDEATHS"]        = killerDeaths,
                ["KILLERNAME"]          = getCreatureName(killer),
                ["KILLERLEVEL"]         = killerLevel,
            
                ["TARGETKILLS"]         = targetKills,
                ["TARGETDEATHS"]        = targetDeaths,
                ["TARGETNAME"]          = getCreatureName(cid),
                ["TARGETLEVEL"]         = targetLevel
            }
            function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
        
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 30)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then
                broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end
    return true
end
 

 

Link para o post
Compartilhar em outros sites
41 minutos atrás, Subyth disse:

Cara, eu também estava com o mesmo problema, tive que refazer todo o script...

 

Tenta trocar

match.max

por

match.maxn

 

Não foi cara :(

Sem título.png

@WhiteBubble Vc poderia me falar Qual parte eu modifico , Pq tipo quando eu copio e colo nem funciona :( e o bug está relacionado a essa parte Max. eu acredito. :( Help-m,e plx kkk

Link para o post
Compartilhar em outros sites

local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 5953,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    
    killerAnimation = {
        use = false,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 1
    },
    targetAnimation = {
        use = false,
        text = "OWNED!!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}
function onDeath(cid, corpse, deathList)
    local killer = deathList[1]
    if isPlayer(killer) then
        for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
            if getPlayerIp(cid) == getPlayerIp(killer) then
                return true
            end
            
            local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
            local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
            
            local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
            local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
            
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
            
            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel
            local values = {
                ["KILLERKILLS"] = killerKills,
                ["KILLERDEATHS"] = killerDeaths,
                ["KILLERNAME"] = getCreatureName(killer),
                ["KILLERLEVEL"] = killerLevel,
                
                ["TARGETKILLS"] = targetKills,
                ["TARGETDEATHS"] = targetDeaths,
                ["TARGETNAME"] = getCreatureName(cid),
                ["TARGETLEVEL"] = targetLevel
            }
            
            local function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
            
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end
    return true
end

 

                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Link para o post
Compartilhar em outros sites
14 minutos atrás, Snowsz disse:

Olá amigo, Mesmo problema.

[26/11/2016 18:44:43] [Error - CreatureScript Interface] 
[26/11/2016 18:44:44] data/creaturescripts/scripts/deathBroadcast.lua:onDeath
[26/11/2016 18:44:44] Description: 
[26/11/2016 18:44:45] data/creaturescripts/scripts/deathBroadcast.lua:37: bad argument #3 to 'max' (number expected, got nil)
[26/11/2016 18:44:45] stack traceback:
[26/11/2016 18:44:46]     [C]: in function 'max'

[26/11/2016 18:44:46]     data/creaturescripts/scripts/deathBroadcast.lua:37: in function <data/creaturescripts/scripts/deathBroadcast.lua:29>

Editado por helix758 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução
local config = {
    affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?
    killStorageValue = 3943,
    deathStorageValue = 3944,
    -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
    rewardItem = {
        use = true,
        itemid = 5953,
        minLevel = false, -- false if you don't want any level req
        minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).
    },
    killMessage = {
        use = true,
        text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
        messageClass = MESSAGE_STATUS_CONSOLE_BLUE
    },
    
    killerAnimation = {
        use = false,
        text = "Frag!", -- Only 9 letters! No "commands" here.
        color = 1
    },
    targetAnimation = {
        use = false,
        text = "OWNED!!", -- Only 9 letters! No "commands" here.
        color = 180
    }
}



function onDeath(cid, corpse, deathList)
    local killer = deathList[1]
    if isPlayer(killer) then
        for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do
            if getPlayerIp(cid) == getPlayerIp(killer) then
                return true
            end
            
            local targetKills = (getPlayerStorageValue(cid, config.killStorageValue) > 0 and getPlayerStorageValue(cid, config.killStorageValue) or 0) + 1
            local targetDeaths = (getPlayerStorageValue(cid, config.deathStorageValue) > 0 and getPlayerStorageValue(cid, config.deathStorageValue) or 0) + 1
            
            local killerKills = (getPlayerStorageValue(killer, config.killStorageValue) > 0 and getPlayerStorageValue(killer, config.killStorageValue) or 0) + 1
            local killerDeaths = (getPlayerStorageValue(killer, config.deathStorageValue) > 0 and getPlayerStorageValue(killer, config.deathStorageValue) or 0) + 1
            
            setPlayerStorageValue(killer, config.killStorageValue, targetKills)
            setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
            
            local killerLevel = getPlayerLevel(killer)
            local targetLevel = getPlayerLevel(cid)
            local levelDiff = targetLevel - killerLevel
            local values = {
                ["KILLERKILLS"] = killerKills,
                ["KILLERDEATHS"] = killerDeaths,
                ["KILLERNAME"] = getCreatureName(killer),
                ["KILLERLEVEL"] = killerLevel,
                
                ["TARGETKILLS"] = targetKills,
                ["TARGETDEATHS"] = targetDeaths,
                ["TARGETNAME"] = getCreatureName(cid),
                ["TARGETLEVEL"] = targetLevel
            }
            
            local function formateString(str)
                return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
            end
            
            if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then
                local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1)
            end
            if(config.killMessage.use) then
                doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
            end
            if(config.killerAnimation.use) then
                doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
            end
            if(config.targetAnimation.use) then
                doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
            end
        end
    end
    return true
end

 

Editado por Snowsz (veja o histórico de edições)
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Link para o post
Compartilhar em outros sites

@Snowsz Funcionou!! Leks ;)

@Snowsz Boa mano,. Funcionou porem houve um bug não sei se faz parte dessa script mas acredito que sim, Se liga. 

19:29 You owned Qoiqweq! You have now 3 kills!   <- eu mato mais de 100 Players e só fica em 3 Kills :( , tlgd? deveria aumenta 4 Kill, 5 KIll, Poderia ajeitar isso :(  

Editado por helix758 (veja o histórico de edições)
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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo