Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ZARP = ZARP or {}
- ZARP.Perks = ZARP.Perks or {}
- ZARP.PerkData = ZARP.PerkData or {}
- function ZARP.RegisterPerk(name,model,material,perkhook,cost,description,callback)
- if not name then FP:Log("Missing name while registering perk!", FP_ErrorLog) return end
- if not model then FP:Log("Missing model while registering perk!", FP_ErrorLog) return end
- if not callback then FP:Log("Missing callback while registering perk!", FP_ErrorLog) return end
- local map = game.GetMap()
- if ZARP.Perks.MapLocations[map] and ZARP.Perks.MapLocations[map][name] then
- local tbl = ZARP.Perks.MapLocations[map][name]
- ZARP.PerkData[name] = {name = name, model = model,material = material, vector = tbl.pos, angle = tbl.angel,perkhook = perkhook,cost = cost,description=description, callback = callback}
- else
- print("[ZARP-PERKS] Map data doesnt exist!\n")
- end
- end
- local debugprints = true
- local function JuggernogCallback(ply,hitgroup,dmginfo)
- if not ply:ActivePerk("Juggernog") then return end
- if (ply:IsPlayer() and hitgroup != HITGROUP_HEAD) then // Lets ignore headshots.
- if debugprints then
- print("ZARP Perks: Juggernog")
- print(dmginfo:GetDamage())
- print(dmginfo:GetDamage()*0.8)
- end
- dmginfo:ScaleDamage(0.8)
- end
- end
- local function DeadshotCallback(ply,hitbox,dmginfo)
- local target = dmginfo:GetAttacker()
- if not IsValid(target) then return end
- if not target:ActivePerk("Deadshot Daiquiri") then return end
- if ply:IsPlayer() and target:IsPlayer() then
- if debugprints then
- print("ZARP Perks: Deadshot Daiquiri")
- print(dmginfo:GetDamage())
- print(dmginfo:GetDamage()*1.3)
- end
- dmginfo:ScaleDamage(1.3)
- end
- end
- local function StaminCallback(ply)
- if not ply:ActivePerk("Stamin-Up") then return end
- if ply:IsPlayer() then
- ply:SetNWFloat("ttt_stamina", 100000)
- if debugprints then
- print("ZARP Perks: Stamin-Up")
- print(ply:GetNWFloat("ttt_stamina"))
- end
- end
- end
- -- ttt_minecraft_b5c1
- // ZARP.RegisterPerk("Deadshot Daiquiri", "models/yolojoenshit/bo3perks/deadshot/mc_mtl_p7_zm_vending_deadshot.mdl","zarp/perks/deadshot-perk.png", Vector(-901.65625, 267.1875, -655.625), Angle(-0.87890625, -90, 0), "ScalePlayerDamage",5000,DeadshotCallback)
- // ZARP.RegisterPerk("Stamin-Up", "models/yolojoenshit/bo3perks/staminup/mc_mtl_p7_zm_vending_marathon.mdl","zarp/perks/stamin-perk.png", Vector(257.71875, -642.75, -623.53125), Angle(-0.87890625, 90, 0),"KeyPress",5000,StaminCallback)
- // ZARP.RegisterPerk("Juggernog", "models/yolojoenshit/bo3perks/juggernog/mc_mtl_p7_zm_vending_jugg.mdl","zarp/perks/juggernog-perk.png", Vector(656.28125, 133.84375, -335.65625),Angle(-0.17578125, 0.4833984375, -0.0439453125), "ScalePlayerDamage",5000,JuggernogCallback)
- -- map data
- ZARP.Perks.MapLocations = ZARP.Perks.MapLocations or {}
- ZARP.Perks.MapLocations["ttt_minecraft_b5"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(-1485.4375, 629.3125, 96.8125), angel = Angle(0, -89.912109375, 0)},
- ["Stamin-Up"] = {pos = Vector(-304.472656, -271.915283, 192.031250), angel = Angle(0, 90.040092, 0)},
- ["Juggernog"] = {pos = Vector(82.15625, 497.5625, 416.1875), angel = Angle(0, -0.2197265625, 0)}
- }
- ZARP.Perks.MapLocations["ttt_bb_teenroom_b2"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(809.768372, 1151.029053, 80.031250) , angel = Angle(0, -93.198647, 0)},
- ["Stamin-Up"] = {pos = Vector(1307.773315, -485, 1056.031250), angel = Angle(0, 87.341362, 0)},
- ["Juggernog"] = {pos = Vector(1355.992188, -912.122253, 1384.031250), angel = Angle(0, 180, 0)}
- }
- ZARP.Perks.MapLocations["ttt_community_bowling_v5a"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(535.140137, 2092.155518, 168.031250), angel = Angle(0, -88, 0)},
- ["Stamin-Up"] = {pos = Vector(635.840576, -842.830811, 108.031250), angel = Angle(0, -1.320169, 0)},
- ["Juggernog"] = {pos = Vector(-673.56677246094, -623.96875, 44.030120849609), angel = Angle(0, 90.200134277344, 0)}
- }
- ZARP.Perks.MapLocations["ttt_67thway_v6"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(-921.255066, 204.770203, 296.031250), angel = Angle(0,-87.933800,0)},
- ["Stamin-Up"] = {pos = Vector(-928.705505, 1887.799561, 152.031250), angel = Angle(0, -90, 0)},
- ["Juggernog"] = {pos = Vector(-1279.604004, 6119.647461, 288.031250), angel = Angle(0, -90, 0)}
- }
- ZARP.Perks.MapLocations["ttt_rooftops_2016_v1"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(871.992554,-1239.208862,642.031250), angel = Angle(0,-179.911041,0)},
- ["Stamin-Up"] = {pos = Vector(336.02355957031, 60.894378662109, 64.03125), angel = Angle(0, -0.7651492357254, 0)},
- ["Juggernog"] = {pos = Vector(2479.968750, 1155.706909, 448.031250), angel = Angle(0,-179.611023,0)}
- }
- ZARP.Perks.MapLocations["ttt_innocentmotel_b6"] = {
- ["Deadshot Daiquiri"] = {pos = Vector(-1215.9995117188, 819.16436767578, 96.03125), angel = Angle(0, -1.5960700511932, 0)},
- ["Stamin-Up"] = {pos = Vector(-460.74514770508, -207.96875, 352.03125), angel = Angle(0, 91.603973388672, 0)},
- ["Juggernog"] = {pos = Vector(239.99824523926, -15.833479881287, -215.96875), angel = Angle(0, 179.24430847168, 0)}
- }
- if CLIENT then
- concommand.Add("perkpos",function(ply)
- local pos = ply:GetPos()
- local ang = ply:GetAngles()
- print("{pos = Vector("..pos.x..", "..pos.y..", "..pos.z.."), angel = Angle(0, "..ang.y..", 0)}")
- end)
- end
- -- Register
- ZARP.RegisterPerk("Juggernog", "models/yolojoenshit/bo3perks/juggernog/mc_mtl_p7_zm_vending_jugg.mdl","zarp/perks/juggernog-perk.png", "ScalePlayerDamage",5000,"Reduces damage you take by 20%",JuggernogCallback)
- ZARP.RegisterPerk("Deadshot Daiquiri", "models/yolojoenshit/bo3perks/deadshot/mc_mtl_p7_zm_vending_deadshot.mdl","zarp/perks/deadshot-perk.png", "ScalePlayerDamage",5000,"Increases damage you deal by 30%",DeadshotCallback)
- //ZARP.RegisterPerk("Stamin-Up", "models/yolojoenshit/bo3perks/staminup/mc_mtl_p7_zm_vending_marathon.mdl","zarp/perks/stamin-perk.png","KeyPress",5000,"Allows you to infinatly run",StaminCallback)
- local meta = FindMetaTable("Player")
- function meta:ActivePerk(name)
- return self.Perks and self.Perks[name]
- end
Advertisement
Add Comment
Please, Sign In to add comment