Need help regarding aimbot
hey
recently I have gotten into lua coding but I am a bit stuck,
I want to make my aimbot switch players when I press right alt, but I don't know how to do that.
Right now all it does is attach to a random player around the map and only de-attaches when they die / you kill them.
- - - Updated - - -
Or if possible make it so that instead of locking on to some random around the map it locks onto who ever is in front of you
recently I have gotten into lua coding but I am a bit stuck,
I want to make my aimbot switch players when I press right alt, but I don't know how to do that.
Code:
hook.Add( "Think", "Aimbot", function()
local ply = LocalPlayer()
for k,v in pairs ( player.GetAll() ) do
if v:Alive() and v:IsValid() then
local head = v:LookupBone("ValveBiped.Bip01_Head1")
local headpos,headang = v:GetBonePosition(head)
if input.IsKeyDown( KEY_LALT ) then
ply:SetEyeAngles((headpos - ply:GetShootPos()):Angle())
if input.IsKeyDown( KEY_RALT) then
end
end
end
end
end)
- - - Updated - - -
Or if possible make it so that instead of locking on to some random around the map it locks onto who ever is in front of you