Advertisement
LordNoobIV

cHeadshot

Apr 22nd, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.04 KB | None | 0 0
  1. scoped = false
  2. timer = Timer()
  3. timer1 = Timer()
  4. timer3 = Timer()
  5.  
  6. function Health(args)
  7.     if args.key == string.byte("M") then
  8.         Game:FireEvent("ply.health.upgrade")
  9.         Chat:Print(tostring(LocalPlayer:GetHealth()), Color(255, 255, 255))
  10.     end
  11. end
  12.  
  13. function PrintHealth(args)
  14.     if args.key == string.byte("N") then
  15.         Chat:Print(tostring(LocalPlayer:GetHealth()), Color(255, 255, 255))
  16.     end
  17. end
  18.  
  19. Events:Subscribe("KeyDown", Health)
  20. Events:Subscribe("KeyDown", PrintHealth)
  21.  
  22. function Cast(args)
  23.  
  24.     local t = {1, 2, 3, 4, 5, 6, 7, 8}
  25.     local r = {1, 2, 3, 4, 5}
  26.     local d = {1, 2, 3}
  27.     tr = table.randomvalue(t)
  28.     rr = table.randomvalue(t)
  29.     dr = table.randomvalue(d)
  30.  
  31.     bones = LocalPlayer:GetBones()
  32.     target = LocalPlayer:GetAimTarget()
  33.  
  34.     dist = Vector3.Distance(LocalPlayer:GetPosition(), LocalPlayer:GetAimTarget().position)
  35.     dist = dist - (rr / 100)
  36.  
  37.  
  38.  
  39.     x = LocalPlayer:GetAimTarget().position.x
  40.     y = LocalPlayer:GetAimTarget().position.y
  41.     z = LocalPlayer:GetAimTarget().position.z
  42.  
  43.     for boneName, bone in pairs(bones) do
  44.         if boneName == "ragdoll_RightForeArm" then
  45.             if scoped == true and timer3:GetSeconds() > 1 then
  46.                 Network:Send("Scattered", bones)
  47.                 timer3:Restart()
  48.             else
  49.                 if tr == 1 then
  50.                     x = x + (dist / 100)
  51.                     y = y + (dist / 100)
  52.                     z = z + (dist / 100)
  53.                 elseif tr == 2 then
  54.                     x = x - (dist / 100)
  55.                     y = y + (dist / 100)
  56.                     z = z + (dist / 100)
  57.                 elseif tr == 3 then
  58.                     x = x + (dist / 100)
  59.                     y = y - (dist / 100)
  60.                     z = z + (dist / 100)
  61.                 elseif tr == 4 then
  62.                     x = x + (dist / 100)
  63.                     y = y + (dist / 100)
  64.                     z = z - (dist / 100)
  65.                 elseif tr == 5 then
  66.                     x = x - (dist / 100)
  67.                     y = y - (dist / 100)
  68.                     z = z + (dist / 100)
  69.                 elseif tr == 6 then
  70.                     x = x - (dist / 100)
  71.                     y = y - (dist / 100)
  72.                     z = z - (dist / 100)
  73.                 elseif tr == 7 then
  74.                     x = x + (dist / 100)
  75.                     y = y - (dist / 100)
  76.                     z = z - (dist / 100)
  77.                 elseif tr == 8 then
  78.                     x = x - (dist / 100)
  79.                     y = y + (dist / 100)
  80.                     z = z - (dist / 100)
  81.                 end
  82.                 scatter = Vector3(x, y, z)
  83.                 myTable = {scatter, bones}
  84.  
  85.                 if timer3:GetSeconds() > 1 then
  86.                     print("Shot")
  87.                     Network:Send("Scattered", myTable)
  88.                     timer3:Restart()
  89.                 end
  90.             end
  91.         end
  92.     end
  93. end
  94.  
  95. Events:Subscribe("MouseDown", Cast)
  96.  
  97. function isScoped(args)
  98.     if args.key == string.byte("C") then
  99.         if scoped == false then
  100.             scoped = true
  101.             print("Trying to scope")
  102.             timer3:Restart()
  103.         else
  104.             scoped = false
  105.         end
  106.     end
  107.  
  108.     if timer3:GetMinutes() > 5 and scoped == true then -- deterring hackers. if the module is reloaded while you are scoped, when you unscope, it will act as if you were scoped.
  109.         Chat:Print("* After a while of scoping, your arms are now tired and you must stop aiming so intensively.", Color(255, 125, 255))
  110.     end
  111. end
  112.  
  113. function RemoveScopeOnDeath()
  114.     scoped = false
  115. end
  116.  
  117. Events:Subscribe("LocalPlayerDeath", RemoveScopeOnDeath)
  118. Events:Subscribe("KeyDown", isScoped)
  119.  
  120. Foo = function(args)
  121.     return false
  122. end
  123.  
  124. Events:Subscribe("LocalPlayerBulletHit", Foo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement