Welcome to AC Web.
Results 1 to 3 of 3
  1. #1

    Erro killStreak System


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    can someone upgrade to azerothcore 3.3.5.

    erro script lua line:110
    player:SendBroadcastMessage("You have to kill another player first in order to get more PvP tokens.")
    victim:SendBroadcastMessage("You have been killed by: |cFF90EE90"..player:GetName().."")

    [Eluna]: Error loading `lua_scripts/Killstreak.lua`
    lua_scripts/Killstreak.lua:5: unexpected symbol near '='


    ************************************************** *********************************************

    KILL = {}

    KILL.TokenId =29434 -- Put your PvPToken ID here.

    KILL.Count = 3 -- How many times a player will be rewarded killing the same other player. For example 3,
    -- player is able to kill the same player 3 times, after that he will not get rewarded a token for killing that player anymore.

    KILL.TokenOne = 1 -- How many tokens players get (kills 1 - 10)
    KILL.TokenTwo = 5 -- How many tokens players get (Reached 10 kills without dying)
    KILL.TokenThree = 5 -- How many tokens players get (kills 11 - 20)
    KILL.TokenFour = 10 -- How many tokens players get (Reached 20 kills without dying)
    KILL.TokenFive = 5 -- How many tokens players get (kills 20 - 30)
    KILL.TokenSix = 15 -- How many tokens players get (Reached 30 kills without dying)
    KILL.TokenSeven = 10 -- How many tokens players get (kills 30 - 40)
    KILL.TokenEight = 20 -- How many tokens players get (Reached 40 kills without dying)
    KILL.TokenNine = 10 -- How many tokens players get (kills 40 - 50)
    KILL.TokenTen = 25 -- How many tokens players get (Reached 50 kills without dying)
    KILL.TokenEleven = 15 -- How many tokens players get (Kills > 50)

    function KILL.OnKillPlayer(event, player, victim)
    if (KILL[player:GetName()] == nil) then
    KILL[player:GetName()] = {}
    KILL[player:GetName()].killstreak = 1
    KILL[victim:GetName()] = {}
    KILL[victim:GetName()].killstreak = 0
    player:SendBroadcastMessage("You have killed player: |cFF90EE90"..victim:GetName().."")
    player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    victim:SendBroadcastMessage("You have been killed by: |cFF90EE90"..player:GetName().."")
    player:AddItem(KILL.TokenId, KILL.TokenOne)
    elseif (KILL[player:GetName()].killstreak == nil) then
    KILL[player:GetName()].killstreak = 1
    KILL[victim:GetName()] = {}
    KILL[victim:GetName()].killstreak = 0
    player:SendBroadcastMessage("You have killed player: |cFF90EE90"..victim:GetName().."")
    player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    victim:SendBroadcastMessage("You have been killed by: |cFF90EE90"..player:GetName().."")
    player:AddItem(KILL.TokenId, KILL.TokenOne)
    else
    if (KILL.PlayerCheck(player, victim) == true) then
    KILL[player:GetName()].killstreak = KILL[player:GetName()].killstreak + 1
    KILL[victim:GetName()] = {}
    KILL[victim:GetName()].killstreak = 0
    player:SendBroadcastMessage("You have killed player: |cFF90EE90"..victim:GetName().."")
    player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    victim:SendBroadcastMessage("You have been killed by: |cFF90EE90"..player:GetName().."")
    if (KILL[player:GetName()].killstreak > 0) then
    if (KILL[player:GetName()].killstreak < 10) then
    player:AddItem(KILL.TokenId, KILL.TokenOne)
    end
    end
    if (KILL[player:GetName()].killstreak == 10) then
    local plrs = GetPlayersInWorld()
    for k, v in pairs(plrs) do
    v:SendBroadcastMessage("|cFFADD8E6[PvP System]: |cFFFFFF00"..player:GetName().." is on a "..KILL[player:GetName()].killstreak.." kill streak.")
    player:AddItem(KILL.TokenId, KILL.TokenTwo)
    end
    end
    if (KILL[player:GetName()].killstreak > 10) then
    if (KILL[player:GetName()].killstreak < 20) then
    player:AddItem(KILL.TokenId, KILL.TokenThree)
    end
    end
    if (KILL[player:GetName()].killstreak == 20) then
    local plrs = GetPlayersInWorld()
    for k, v in pairs(plrs) do
    v:SendBroadcastMessage("|cFFADD8E6[PvP System]: |cFFFFFF00"..player:GetName().." is on a "..KILL[player:GetName()].killstreak.." kill streak.")
    player:AddItem(KILL.TokenId, KILL.TokenFour)
    end
    end
    if (KILL[player:GetName()].killstreak > 20) then
    if (KILL[player:GetName()].killstreak < 30) then
    player:AddItem(KILL.TokenId, KILL.TokenFive)
    end
    end
    if (KILL[player:GetName()].killstreak == 30) then
    local plrs = GetPlayersInWorld()
    for k, v in pairs(plrs) do
    v:SendBroadcastMessage("|cFFADD8E6[PvP System]: |cFFFFFF00"..player:GetName().." is on a "..KILL[player:GetName()].killstreak.." kill streak.")
    player:AddItem(KILL.TokenId, KILL.TokenSix)
    end
    end
    if (KILL[player:GetName()].killstreak > 30) then
    if (KILL[player:GetName()].killstreak < 40) then
    player:AddItem(KILL.TokenId, KILL.TokenSeven)
    end
    end
    if (KILL[player:GetName()].killstreak == 40) then
    local plrs = GetPlayersInWorld()
    for k, v in pairs(plrs) do
    v:SendBroadcastMessage("|cFFADD8E6[PvP System]: |cFFFFFF00"..player:GetName().." is on a "..KILL[player:GetName()].killstreak.." kill streak.")
    player:AddItem(KILL.TokenId, KILL.TokenEight)
    end
    end
    if (KILL[player:GetName()].killstreak > 40) then
    if (KILL[player:GetName()].killstreak < 50) then
    player:AddItem(KILL.TokenId, KILL.TokenNine)
    end
    end
    if (KILL[player:GetName()].killstreak == 50) then
    local plrs = GetPlayersInWorld()
    for k, v in pairs(plrs) do
    v:SendBroadcastMessage("|cFFADD8E6[PvP System]: |cFFFFFF00"..player:GetName().." is on a "..KILL[player:GetName()].killstreak.." kill streak.")
    player:AddItem(KILL.TokenId, KILL.TokenTen)
    end
    end
    if (KILL[player:GetName()].killstreak > 50) then
    player:AddItem(KILL.TokenId, KILL.TokenEleven)
    end
    else
    player:SendBroadcastMessage("You have to kill another player first in order to get more PvP tokens.")
    victim:SendBroadcastMessage("You have been killed by: |cFF90EE90"..player:GetName().."")
    end
    end
    end

    function KILL.PlayerCheck(player, victim)
    if (KILL[player:GetName()].target == victim:GetName()) then
    KILL[player:GetName()].killcount = KILL[player:GetName()].killcount + 1
    if (KILL[player:GetName()].killcount >= KILL.Count) then
    return false
    else
    return true
    end
    else
    KILL[player:GetName()].target = victim:GetName()
    KILL[player:GetName()].killcount = 1
    return true
    end
    end

    RegisterServerHook(2, "KILL.OnKillPlayer")

  2. #2
    Gosh,
    tons of if else's hurting my eyes like glasses

  3. #3

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    KILL.TokenId =29434

    >

    KILL.TokenId = 29434


    it is already mentioned in the error, you should read more carefully

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •