Advertisement
Guest User

blabla

a guest
May 24th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. //64.74.97.127:27015
  2.  
  3.  
  4.  
  5.  
  6.  
  7. local _G = table.Copy( _G )
  8. local _R = _G.debug.getregistry()
  9.  
  10. ply = LocalPlayer()
  11. local EntityM = FindMetaTable("Entity")
  12. local CUserCmdM = FindMetaTable("CUserCmd")
  13. local WeaponM = FindMetaTable("Weapon")
  14. local AngleM = FindMetaTable("Angle")
  15. local VectorM = FindMetaTable("Vector")
  16. local PanelM = FindMetaTable("Panel")
  17. local Player = FindMetaTable("Player")
  18. Target = nil
  19.  
  20.  
  21.  
  22.  
  23. function Player:IsVisible()
  24. if (!IsValid(self)) then return false end //if player isnt Valid
  25. local vecPos, _ = self:GetBonePosition( self:LookupBone( "ValveBiped.Bip01_Head1" ) or 12 ); //get the vector to check
  26. local trace = { start = LocalPlayer():EyePos(), endpos = vecPos, filter = LocalPlayer(), mask = MASK_SHOT };//our trace table
  27. local TraceRes = util.TraceLine( trace ); //the trace res
  28. if (TraceRes.HitWorld || TraceRes.Entity != self) then return false end; //if trace not hit world and not himselfe
  29. return true;
  30. end
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. local function Valid(v)
  39. if !v:Alive() then return false end
  40. //if v:IsBot() then return false end
  41. if v:Team() != ply:Team() then return false end
  42. if v:GetFriendStatus() == "friend" then return false end
  43. if !v:IsVisible() then return false end
  44. if v == LocalPlayer() then return false end
  45. return true
  46. end
  47.  
  48.  
  49.  
  50.  
  51. local function shoot()
  52. if !Firing then
  53. RunConsoleCommand( "+attack" )
  54. Firing = true
  55. end
  56. end
  57. local function notshoot()
  58. if Firing then
  59. RunConsoleCommand( "-attack" )
  60. Firing = false
  61. end
  62. end
  63. local function autoshoot()
  64.  
  65. Firing = false
  66. shoot()
  67. timer.Simple(.0001,notshoot)
  68. end
  69.  
  70.  
  71. local function GetTarget()
  72. local pplayer = nil
  73. local backup = 1000
  74. local dist = nil
  75. for k, v in next, player.GetAll() do
  76. dist = math.abs( math.NormalizeAngle( LocalPlayer():GetAngles().y - (( v:GetPos() - LocalPlayer():EyePos() ):Angle()).y ) )//the math stuff
  77. if (dist ~=nil ) and dist ~= 0 and Valid(v) and dist < backup then
  78. backup = dist
  79. pplayer = v
  80. end
  81. end
  82. Target = pplayer || nil
  83. end
  84.  
  85.  
  86.  
  87. local function FixAngle(angle)
  88. angle.x = math.NormalizeAngle(angle.x)
  89. angle.p = math.Clamp(angle.p, -89, 89)
  90. return angle
  91. end
  92.  
  93. anglefixed = Angle(0,0,0)
  94. require("cvar3")
  95. //GetConVar("sv_Cheats"):SetValue(1)
  96. //GetConVar("host_framerate"):SetValue(12)
  97.  
  98. local function Aimbot(cmd)
  99. GetTarget()
  100. cmd:SetViewAngles(Angle(-181, 0, 181))
  101.  
  102. if Target then
  103. local pos = Target:GetBonePosition( Target:LookupBone( "ValveBiped.Bip01_Head1" ))
  104. local theangle = (pos-LocalPlayer():GetShootPos()):Angle()
  105. local anglefixed = FixAngle(theangle- Angle(ply:GetVelocity() * engine.TickInterval()))
  106. cmd:SetViewAngles(anglefixed)
  107. autoshoot()
  108.  
  109. end
  110.  
  111. end
  112.  
  113. hook.Add("CreateMove" , "", function(cmd)
  114. Aimbot(cmd)
  115. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement