Killstreak LUA menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Cookie16's Avatar Corporal
    Reputation
    6
    Join Date
    Aug 2012
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Killstreak LUA

    Here is a simple Kill-streak System
    I'm sure there is plenty but here is one more.


    Code:
    KILL = {}
    
    KILL.TokenId = TOKENIDHERE
    
    KILL.Count = 3
    						
    
    KILL.TokenOne = 1
    KILL.TokenTwo = 5
    KILL.TokenThree = 5
    KILL.TokenFour = 10
    KILL.TokenFive = 5
    KILL.TokenSix = 15
    KILL.TokenSeven = 10
    KILL.TokenEight = 20
    KILL.TokenNine = 10
    KILL.TokenTen = 25
    KILL.TokenEleven = 15	
    
    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 owned: |cFF90EE90"..victim:GetName().."")
    		player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    		victim:SendBroadcastMessage("You got owned 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 owned: |cFF90EE90"..victim:GetName().."")
    		player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    		victim:SendBroadcastMessage("You got owned 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 owned: |cFF90EE90"..victim:GetName().."")
    			player:SendBroadcastMessage("Killstreak: |cFF90EE90"..KILL[player:GetName()].killstreak.."")
    			victim:SendBroadcastMessage("You got owned 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 got owned 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") -- Cookie16 Owned-Core
    +Hugs - Coloring the code took me 1 Hour and 47 Minutes :'(


    -- Cookie

    Killstreak LUA
  2. #2
    infuried's Avatar Private
    Reputation
    2
    Join Date
    Feb 2013
    Posts
    2
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good job! We really need more dedicated scripters to help the community out like this, even for people that are inexperienced in coding LUA. (like me) Just reviewing the code helps better understand LUA scripts.

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  3. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
  4. LUA Refrences
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-22-2007, 08:09 PM
All times are GMT -5. The time now is 10:15 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search