Code:
--[[ Designed to work with....
__ __ __ ______
/\ \ /\ \/\ \ /\ _ \
\ \ \ __ __ __ \ \ \_\ \ __ __ _____\ \ \_\ \ _____ ___
\ \ \ __/\ \/\ \ /'__`\ \ \ _ \/\ \/\ \/\ '__`\ \ __ \/\`'__\/'___\
\ \ \_\ \ \ \_\ \/\ \_\.\_\ \ \ \ \ \ \_\ \ \ \_\ \ \ \/\ \ \ \//\ \__/
\ \____/\ \____/\ \__/ \_\\ \_\ \_\/`____ \ \ __/\ \_\ \_\ \_\\ \____\
\/___/ \/___/ \/__/\/_/ \/_/\/_/`/___// \ \ \/ \/_/\/_/\/_/ \/____/
/\___/\ \_\
\/__/ \/_/ .zapto.org
(LuaHypArc.zapto.org)
Custom Bounty PvP System
Made by DarkBoy101
]]--
bounty_table = {}
local killcount = 0
local BOUNTY_MSG = "#bounty"
function Register(Unit, pPlayer, Event)
local PPLAYERNAME = pPlayer:GetName()
table.insert(""...PPLAYERNAME..."", 100000)
end
end
function KillCount(pKilled, pPlayer, Event)
pPlayer:Killcount = killcount + 1
pPlayer:RegisterEvent("KillMessage", 1000, 1)
if pPlayer:IsDead() then
killcount = 0
end
end
function KillMessage(pPlayer, Unit, Event)
local PPLAYERNAME = pPlayer:GetName()
if(killcount > 5) then
pPlayer:SendChatMessage(0, 0, ""...PPLAYERNAME..." has gone on a killing spree, killing "...killcount..." consecutive players, and now has a bounty of ["...PPLAYERNAME..."] ")
end
end
function Bounty (pPlayer, pKilled, Event)
local PPLAYERNAME = pPlayer:GetName()
local PKILLEDNAME = pKilled:GetName()
bounty_table["...PPLAYERNAME..."] + ["...PKILLEDNAME..."]
bounty_table["...PKILLEDNAME..."] = 100000
pPlayer:AddItem(TOKENID, AMOUNT)
pPlayer:DealGoldMerit(["...PKILLEDNAME..."])
pKilled:DealGoldCost(["...PKILLEDNAME..."])
end
end
function OnChat(event, plr, message, type, language, pPlayer)
local PPLAYERNAME = pPlayer:GetName()
if (message == BOUNTY_MSG) then
plr:SendBroadcastMessage("You currentley have a bounty of ["...PPLAYERNAME.."] on your head. The last 4 digits are gold and silver.")
end
end
RegisterServerHook(3, "Register")
RegisterServerHook(23, "KillCount")
RegisterServerHook(23, "Bounty")
RegisterServerHook(16, "OnChat")