Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //64.74.97.127:27015
- local _G = table.Copy( _G )
- local _R = _G.debug.getregistry()
- ply = LocalPlayer()
- local EntityM = FindMetaTable("Entity")
- local CUserCmdM = FindMetaTable("CUserCmd")
- local WeaponM = FindMetaTable("Weapon")
- local AngleM = FindMetaTable("Angle")
- local VectorM = FindMetaTable("Vector")
- local PanelM = FindMetaTable("Panel")
- local Player = FindMetaTable("Player")
- Target = nil
- function Player:IsVisible()
- if (!IsValid(self)) then return false end //if player isnt Valid
- local vecPos, _ = self:GetBonePosition( self:LookupBone( "ValveBiped.Bip01_Head1" ) or 12 ); //get the vector to check
- local trace = { start = LocalPlayer():EyePos(), endpos = vecPos, filter = LocalPlayer(), mask = MASK_SHOT };//our trace table
- local TraceRes = util.TraceLine( trace ); //the trace res
- if (TraceRes.HitWorld || TraceRes.Entity != self) then return false end; //if trace not hit world and not himselfe
- return true;
- end
- local function Valid(v)
- if !v:Alive() then return false end
- //if v:IsBot() then return false end
- if v:Team() != ply:Team() then return false end
- if v:GetFriendStatus() == "friend" then return false end
- if !v:IsVisible() then return false end
- if v == LocalPlayer() then return false end
- return true
- end
- local function shoot()
- if !Firing then
- RunConsoleCommand( "+attack" )
- Firing = true
- end
- end
- local function notshoot()
- if Firing then
- RunConsoleCommand( "-attack" )
- Firing = false
- end
- end
- local function autoshoot()
- Firing = false
- shoot()
- timer.Simple(.0001,notshoot)
- end
- local function GetTarget()
- local pplayer = nil
- local backup = 1000
- local dist = nil
- for k, v in next, player.GetAll() do
- dist = math.abs( math.NormalizeAngle( LocalPlayer():GetAngles().y - (( v:GetPos() - LocalPlayer():EyePos() ):Angle()).y ) )//the math stuff
- if (dist ~=nil ) and dist ~= 0 and Valid(v) and dist < backup then
- backup = dist
- pplayer = v
- end
- end
- Target = pplayer || nil
- end
- local function FixAngle(angle)
- angle.x = math.NormalizeAngle(angle.x)
- angle.p = math.Clamp(angle.p, -89, 89)
- return angle
- end
- anglefixed = Angle(0,0,0)
- require("cvar3")
- //GetConVar("sv_Cheats"):SetValue(1)
- //GetConVar("host_framerate"):SetValue(12)
- local function Aimbot(cmd)
- GetTarget()
- cmd:SetViewAngles(Angle(-181, 0, 181))
- if Target then
- local pos = Target:GetBonePosition( Target:LookupBone( "ValveBiped.Bip01_Head1" ))
- local theangle = (pos-LocalPlayer():GetShootPos()):Angle()
- local anglefixed = FixAngle(theangle- Angle(ply:GetVelocity() * engine.TickInterval()))
- cmd:SetViewAngles(anglefixed)
- autoshoot()
- end
- end
- hook.Add("CreateMove" , "", function(cmd)
- Aimbot(cmd)
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement