Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- BY DIABLOS / FOR WOLFY | PRICE: $15.00
  2. -- NO COPYRIGHT PRACTICED. FEEL FREE TO EDIT THAT AT YOUR OWN RISK.
  3. -- IF THAT WORKS FOR ME, THAT WORKS FOR YOU. I SUPPORT THIS SCRIPT ONE DAY AFTER THE PURCHASE. AFTER, NO BECAUSE IT IS VERY SMALL AND SHOULDN'T CREATE PROBLEMs.
  4. -- IF YOU NEED OTHER SCRIPTS, GO AT steamcommunity.com/id/diablosgamer
  5.  
  6. -- [[ Runner and Juggernaut Script ]] --
  7.  
  8. --local walkspeed = 160 -- The walk speed (equivalent to the speed in which we run) -- "Doesn't matter now, made the script clever." - Fillipuster
  9. local teamscantrun = { -- Put the name (not TEAM_ variable) of jobs who can't run
  10.     "Juggernaut"
  11. }
  12.  
  13. local function CantRun(ply, before, after)
  14.     if table.HasValue(teamscantrun, team.GetName( after )) and ply:Alive() then
  15.         ply:SetRunSpeed( ply:GetWalkSpeed() ) -- ply:SetRunSpeed( walkspeed )
  16.     end
  17. end
  18. hook.Add("OnPlayerChangedTeam", "CantRun", CantRun)
  19.  
  20. -- [[ Chat Command Script ]] --
  21.  
  22. local timebetweeneverytrack = 240 -- Time (in seconds) for every track.
  23. local timeoftrackhud = 120 -- Time (in seconds) when the tracker sees the HUD information.
  24. local teamscantrackplayers = { -- Put the name (not TEAM_ variable) of jobs who can track players
  25.     "Detective"
  26. }
  27.  
  28. local tableofpeople, tableofpeoplenick = {}, {} -- NO CONFIGURATION
  29. local thetracker, theplayer, thenotifynumber, thenotifytext -- NO CONFIGURATION
  30. local recuptime = timebetweeneverytrack -- NO CONFIGURATION
  31. if CLIENT then
  32.     hook.Add("OnPlayerChat", "thetrackcommand", function( pl, text )
  33.         if string.sub(text, 1, 6) == "/track" and table.HasValue(teamscantrackplayers, team.GetName(pl:Team())) then
  34.             if CurTime() > timebetweeneverytrack then
  35.                 tableofpeople = {}
  36.                 tableofpeoplenick = {}
  37.                 for _, ply in pairs(player.GetAll()) do
  38.                     table.insert(tableofpeople, ply)
  39.                     table.insert(tableofpeoplenick, string.lower(ply:Nick()))
  40.                 end
  41.                 if table.HasValue(tableofpeoplenick, string.lower(string.sub(text, 8))) then
  42.                     local goodkey = table.KeyFromValue(tableofpeoplenick, string.lower(string.sub(text, 8)))
  43.                     victim = tableofpeople[goodkey]
  44.                     theplayer = pl
  45.                     timebetweeneverytrack = CurTime() + recuptime
  46.                     net.Start("NotifyThePlayer")
  47.                         net.WriteUInt(0, 1)
  48.                         net.WriteString("You've successfully created a track !")
  49.                     net.SendToServer()
  50.                 else
  51.                     net.Start("NotifyThePlayer")
  52.                         net.WriteUInt(1, 1)
  53.                         net.WriteString("The name you say is incorrect !")
  54.                     net.SendToServer()
  55.                 end
  56.             return true
  57.             elseif CurTime() < timebetweeneverytrack then
  58.                 net.Start(&quot;NotifyThePlayer&quot;)
  59.                     net.WriteUInt(1, 1)
  60.                     net.WriteString(&quot;You can't create a track because you must wait for a new!&quot;)
  61.                 net.SendToServer()
  62.                 return true
  63.             end
  64.         elseif string.sub(text, 1, 6) == &quot;/track&quot; and not table.HasValue(teamscantrackplayers, team.GetName(pl:Team())) then
  65.             net.Start(&quot;NotifyThePlayer&quot;)
  66.                 net.WriteUInt(1, 1)
  67.                 net.WriteString(&quot;You can't create a track because you aren't in a good job!&quot;)
  68.             net.SendToServer()
  69.         return true
  70.         end
  71.     end)
  72.     hook.Add( &quot;HUDPaint&quot;, &quot;showtheinformations&quot;, function()
  73.         if !IsValid(theplayer) or !IsValid(victim) then return end
  74.  
  75.         if LocalPlayer() == theplayer then
  76.             local dist = math.floor(theplayer:GetPos():Distance( victim:GetPos() ) / 25)
  77.  
  78.             local spos = Vector(victim:GetPos().x, victim:GetPos().y, victim:GetPos().z):ToScreen()
  79.  
  80.             draw.DrawText( victim:Nick()..&quot; - &quot; .. dist .. &quot; m&quot;, &quot;Trebuchet24&quot;, spos.x - 35, spos.y - 20, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER )
  81.             timer.Simple(timeoftrackhud, function()
  82.                 theplayer = nil
  83.                 victim = nil
  84.             end)
  85.         end
  86.     end )
  87. else
  88.     util.AddNetworkString(&quot;NotifyThePlayer&quot;)
  89.     net.Receive(&quot;NotifyThePlayer&quot;, function( len, ply )
  90.         thenotifynumber = net.ReadUInt(1)
  91.         thenotifytext = net.ReadString()
  92.         DarkRP.notify(ply, thenotifynumber, 4, thenotifytext)
  93.     end )
  94. end
  95.  
  96. -- [[ Health Regeneration Script ]] --
  97.  
  98. if SERVER then
  99.     local healthreg_numberofhp = 5 -- Number of HPs you win
  100.     local healthreg_speed = 1 -- 1 HP every X second(s)
  101.     local healthreg_delay = 5 -- Delay after that the regen begins
  102.     local teamsforhealthreg = { -- Put the name (not TEAM_ variable) of jobs who will be generated
  103.         &quot;Deadpool&quot;
  104.     }
  105.  
  106.     local function HealthRegen()
  107.         local time = FrameTime()
  108.        
  109.         for _, ply in pairs(player.GetAll()) do
  110.             if table.HasValue(teamsforhealthreg, team.GetName(ply:Team())) and ply:Alive() then
  111.                 local health = ply:Health()
  112.                 ply.HealthRegen = ( ply.HealthRegen or 0 ) + time
  113.                     if ( ply.HealthRegen >= healthreg_speed ) then
  114.                         ply.HealthRegen = 0
  115.                         if ( health < 100 || healthreg_speed < 0 ) then
  116.                             ply:SetHealth( health + healthreg_numberofhp )
  117.                         end
  118.                     end
  119.             ply.LastHealth = ply:Health()
  120.             end
  121.         end
  122.     end
  123.     hook.Add( &quot;Think&quot;, &quot;HealthRegeneration&quot;, HealthRegen )
  124. end
  125.  
  126. -- ALL SCRIPTS ARE NOT UNDER COPYRIGHT BUT PLEASE DON'T GIVE THIS ADDON FOR OTHER PEOPLE.
  127. -- BY DIABLOS. JUNE 2016.
  128. -- THANKS FOR COOPERATION / KINDNESS.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement