LUA Error. menu

Shout-Out

User Tag List

Thread: LUA Error.

Results 1 to 3 of 3
  1. #1
    EmuX's Avatar Active Member
    Reputation
    29
    Join Date
    Feb 2008
    Posts
    172
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Error.

    I don't know why but I get this error:

    Code:
    scripts\pvpkillstreak.lua:39: 'then' expected near ')'
    When I try to run this script (Line 39 in red):

    Code:
    KILL = {}
    
    KILL.TokenId = 	40753		-- 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 = 4		-- How many tokens players get (Reached 10 kills without dying)
    KILL.TokenThree	= 1		-- How many tokens players get (kills 11 - 20)
    KILL.TokenFour = 8		-- How many tokens players get (Reached 20 kills without dying)
    KILL.TokenFive = 1 		-- How many tokens players get (kills 20 - 30)
    KILL.TokenSix = 12		-- How many tokens players get (Reached 30 kills without dying)
    KILL.TokenSeven	= 1	-- How many tokens players get (kills 30 - 40)
    KILL.TokenEight = 16	-- How many tokens players get (Reached 40 kills without dying)
    KILL.TokenNine = 1		-- How many tokens players get (kills 40 - 50)
    KILL.TokenTen = 20 		-- How many tokens players get (Reached 50 kills without dying)
    KILL.TokenEleven = 5	-- 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")

    LUA Error.
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    KILL = {}
    
    KILL.TokenId =     40753        -- 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 = 4        -- How many tokens players get (Reached 10 kills without dying)
    KILL.TokenThree    = 1        -- How many tokens players get (kills 11 - 20)
    KILL.TokenFour = 8        -- How many tokens players get (Reached 20 kills without dying)
    KILL.TokenFive = 1         -- How many tokens players get (kills 20 - 30)
    KILL.TokenSix = 12        -- How many tokens players get (Reached 30 kills without dying)
    KILL.TokenSeven    = 1    -- How many tokens players get (kills 30 - 40)
    KILL.TokenEight = 16    -- How many tokens players get (Reached 40 kills without dying)
    KILL.TokenNine = 1        -- How many tokens players get (kills 40 - 50)
    KILL.TokenTen = 20         -- How many tokens players get (Reached 50 kills without dying)
    KILL.TokenEleven = 5    -- 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")
    Fixed, you had one too many ")"'s

  3. #3
    EmuX's Avatar Active Member
    Reputation
    29
    Join Date
    Feb 2008
    Posts
    172
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much Ground Zero.

Similar Threads

  1. [Help] Lua Error (eof)
    By Moffeman in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-19-2008, 01:48 PM
  2. LUA error
    By mager1794 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-23-2008, 07:17 PM
  3. LUA Error.
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-07-2008, 04:31 PM
  4. [Lua] Error
    By ~ViVo~ in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-15-2008, 11:15 AM
  5. [Errorz] A Lua Error I Havent seen before
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-14-2008, 10:12 AM
All times are GMT -5. The time now is 06:37 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search