Aek177

TTT sh_perks.lua

Jun 13th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. ZARP = ZARP or {}
  2. ZARP.Perks = ZARP.Perks or {}
  3. ZARP.PerkData = ZARP.PerkData or {}
  4.  
  5. function ZARP.RegisterPerk(name,model,material,perkhook,cost,description,callback)
  6. if not name then FP:Log("Missing name while registering perk!", FP_ErrorLog) return end
  7. if not model then FP:Log("Missing model while registering perk!", FP_ErrorLog) return end
  8. if not callback then FP:Log("Missing callback while registering perk!", FP_ErrorLog) return end
  9. local map = game.GetMap()
  10. if ZARP.Perks.MapLocations[map] and ZARP.Perks.MapLocations[map][name] then
  11. local tbl = ZARP.Perks.MapLocations[map][name]
  12. ZARP.PerkData[name] = {name = name, model = model,material = material, vector = tbl.pos, angle = tbl.angel,perkhook = perkhook,cost = cost,description=description, callback = callback}
  13. else
  14. print("[ZARP-PERKS] Map data doesnt exist!\n")
  15. end
  16. end
  17.  
  18. local debugprints = true
  19. local function JuggernogCallback(ply,hitgroup,dmginfo)
  20. if not ply:ActivePerk("Juggernog") then return end
  21. if (ply:IsPlayer() and hitgroup != HITGROUP_HEAD) then // Lets ignore headshots.
  22. if debugprints then
  23. print("ZARP Perks: Juggernog")
  24. print(dmginfo:GetDamage())
  25. print(dmginfo:GetDamage()*0.8)
  26. end
  27. dmginfo:ScaleDamage(0.8)
  28. end
  29. end
  30.  
  31.  
  32. local function DeadshotCallback(ply,hitbox,dmginfo)
  33. local target = dmginfo:GetAttacker()
  34. if not IsValid(target) then return end
  35. if not target:ActivePerk("Deadshot Daiquiri") then return end
  36. if ply:IsPlayer() and target:IsPlayer() then
  37. if debugprints then
  38. print("ZARP Perks: Deadshot Daiquiri")
  39. print(dmginfo:GetDamage())
  40. print(dmginfo:GetDamage()*1.3)
  41. end
  42. dmginfo:ScaleDamage(1.3)
  43. end
  44. end
  45.  
  46. local function StaminCallback(ply)
  47. if not ply:ActivePerk("Stamin-Up") then return end
  48. if ply:IsPlayer() then
  49. ply:SetNWFloat("ttt_stamina", 100000)
  50. if debugprints then
  51. print("ZARP Perks: Stamin-Up")
  52. print(ply:GetNWFloat("ttt_stamina"))
  53. end
  54. end
  55. end
  56.  
  57. -- ttt_minecraft_b5c1
  58. // 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)
  59. // 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)
  60. // 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)
  61.  
  62. -- map data
  63. ZARP.Perks.MapLocations = ZARP.Perks.MapLocations or {}
  64. ZARP.Perks.MapLocations["ttt_minecraft_b5"] = {
  65. ["Deadshot Daiquiri"] = {pos = Vector(-1485.4375, 629.3125, 96.8125), angel = Angle(0, -89.912109375, 0)},
  66. ["Stamin-Up"] = {pos = Vector(-304.472656, -271.915283, 192.031250), angel = Angle(0, 90.040092, 0)},
  67. ["Juggernog"] = {pos = Vector(82.15625, 497.5625, 416.1875), angel = Angle(0, -0.2197265625, 0)}
  68. }
  69.  
  70. ZARP.Perks.MapLocations["ttt_bb_teenroom_b2"] = {
  71. ["Deadshot Daiquiri"] = {pos = Vector(809.768372, 1151.029053, 80.031250) , angel = Angle(0, -93.198647, 0)},
  72. ["Stamin-Up"] = {pos = Vector(1307.773315, -485, 1056.031250), angel = Angle(0, 87.341362, 0)},
  73. ["Juggernog"] = {pos = Vector(1355.992188, -912.122253, 1384.031250), angel = Angle(0, 180, 0)}
  74. }
  75.  
  76. ZARP.Perks.MapLocations["ttt_community_bowling_v5a"] = {
  77. ["Deadshot Daiquiri"] = {pos = Vector(535.140137, 2092.155518, 168.031250), angel = Angle(0, -88, 0)},
  78. ["Stamin-Up"] = {pos = Vector(635.840576, -842.830811, 108.031250), angel = Angle(0, -1.320169, 0)},
  79. ["Juggernog"] = {pos = Vector(-673.56677246094, -623.96875, 44.030120849609), angel = Angle(0, 90.200134277344, 0)}
  80. }
  81.  
  82. ZARP.Perks.MapLocations["ttt_67thway_v6"] = {
  83. ["Deadshot Daiquiri"] = {pos = Vector(-921.255066, 204.770203, 296.031250), angel = Angle(0,-87.933800,0)},
  84. ["Stamin-Up"] = {pos = Vector(-928.705505, 1887.799561, 152.031250), angel = Angle(0, -90, 0)},
  85. ["Juggernog"] = {pos = Vector(-1279.604004, 6119.647461, 288.031250), angel = Angle(0, -90, 0)}
  86. }
  87.  
  88. ZARP.Perks.MapLocations["ttt_rooftops_2016_v1"] = {
  89. ["Deadshot Daiquiri"] = {pos = Vector(871.992554,-1239.208862,642.031250), angel = Angle(0,-179.911041,0)},
  90. ["Stamin-Up"] = {pos = Vector(336.02355957031, 60.894378662109, 64.03125), angel = Angle(0, -0.7651492357254, 0)},
  91. ["Juggernog"] = {pos = Vector(2479.968750, 1155.706909, 448.031250), angel = Angle(0,-179.611023,0)}
  92. }
  93.  
  94. ZARP.Perks.MapLocations["ttt_innocentmotel_b6"] = {
  95. ["Deadshot Daiquiri"] = {pos = Vector(-1215.9995117188, 819.16436767578, 96.03125), angel = Angle(0, -1.5960700511932, 0)},
  96. ["Stamin-Up"] = {pos = Vector(-460.74514770508, -207.96875, 352.03125), angel = Angle(0, 91.603973388672, 0)},
  97. ["Juggernog"] = {pos = Vector(239.99824523926, -15.833479881287, -215.96875), angel = Angle(0, 179.24430847168, 0)}
  98. }
  99.  
  100. if CLIENT then
  101. concommand.Add("perkpos",function(ply)
  102. local pos = ply:GetPos()
  103. local ang = ply:GetAngles()
  104. print("{pos = Vector("..pos.x..", "..pos.y..", "..pos.z.."), angel = Angle(0, "..ang.y..", 0)}")
  105. end)
  106. end
  107.  
  108. -- Register
  109. 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)
  110. 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)
  111. //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)
  112.  
  113. local meta = FindMetaTable("Player")
  114. function meta:ActivePerk(name)
  115. return self.Perks and self.Perks[name]
  116. end
Advertisement
Add Comment
Please, Sign In to add comment