Postsimple prophunt aimbot

Posts 1–7 of 7 · Page 1 of 1
simple prophunt aimbot
hi , I am still new to lua hacking and I wrote a
prophunt aimbot , that aim to the closest prop possible

Video www youtube com/ watch?v=sHjJVyCV7kM

Code:
local dis
local pos
local PropPlayers
local GetPosition



local Num = {}
for i = 0,32 do 
Num[i] = 16000; 
end


local function HowManyPropsAlive()
	local CountPlayer={}
	for k,v in next,team.GetPlayers(2) do --team.GetPlayers(2) are props
		if(v:Alive()) then 
			table.insert(CountPlayer,v)
		end 
	end 
	return #CountPlayer  
end 

local function CHECK(Prop)
	PropPlayers = HowManyPropsAlive()
	for j = 0,32 do
		if(PropPlayers == 0) then Num[j] = 16000 return end 
		Num[j] = Prop[PropPlayers]
		PropPlayers = PropPlayers - 1
	end 
	return 
end 

local function main() 
	if (team.GetName(LocalPlayer():Team()) == "Hunters") then 
	local Prop = {}
		for k,v in next,team.GetPlayers(2) do 
			 pos = v:GetPos():ToScreen()
			if v:Alive() and v != LocalPlayer() then 
				 dis = math****und(v:GetPos():Distance(LocalPlayer():GetPos()),0)
				table.insert(Prop,dis)
			end 
		end 
		for k,v in next,team.GetPlayers(2) do 
			CHECK(Prop)
			if math****und(math.min(Num[0],Num[1],Num[2],Num[3],Num[4],Num[5],Num[6],Num[7],Num[8],Num[9],Num[10],Num[11],Num[12],Num[13],Num[14],Num[15],Num[16],Num[17],Num[18],Num[19],Num[20],Num[21],Num[22],Num[23],Num[24],Num[25],Num[26],Num[27],Num[28],Num[29],Num[30],Num[31]) , 0 ) == math****und(v:GetPos():Distance(LocalPlayer():GetPos()),0) then
				pos = v:GetPos()
				if (input.IsKeyDown(KEY_F)) then 
					 GetPosition = (Vector( pos.x,pos.y,pos.z+5) - LocalPlayer():GetShootPos()):Angle()
					LocalPlayer():SetEyeAngles(GetPosition) 
					CHECK(Prop)
				end 
			end 
		end  
	end 	
end	
		
timer.Create( "ThisShouldBeLongToGetLessErrors", 0.001 , 0 , main)
How to use : -
Press the F key to aim.

hope u enjoy it .

EDIT: I see mathdotRound in the code turned to math****und pls fix
this is pretty awful tbh
but at least it isn't another memeware release

Here's a better way of doing it
Code:
-- You only ever need to call this once, LocalPlayer will never change in-game.
local me = LocalPlayer()

local PropAimbot = function(cmd)
	-- Check if F is being pressed and you're on team "Hunters".
	if (!input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS) then return end
	
	-- If we make this global it might produce errors.
	local Target = nil
	-- Cache LocalPlayer's position, we don't need to call it every iteration in the loop.
	local MyPos, ShortestDistance = me:GetPos(), math.huge
	
	-- Loop through players on team "Props".
	for i, ply in ipairs(team.GetPlayers(TEAM_PROPS)) do
		-- If the player isn't alive then ignore them
		if !(ply:Alive()) then continue end
		
		-- Get the distance between LocalPlayer's position and ply's position.
		-- Use Vector:DistToSqr(OtherVector) for stuff like this, Vector:Distance(OtherVector) would be a waste of CPU cycles.
		local Distance = MyPos:DistToSqr(ply:GetPos())
		
		-- If Distance is smaller than ShortestDistance it means it's even shorter.
		if (ShortestDistance > Distance) then
			-- Make Target the player so we can use it later on.
			Target = ply
			-- Set ShortestDistance to the new shortest distance.
			ShortestDistance = Distance
		end
	end
	
	-- Target will be nil if the above loop doesn't find any targets and would throw errors.
	if (Target) then
		-- This would get the center of the target's model.
		local vec = Target:GetPos() + Target:OBBCenter()
		-- Get the angle pointing to the target.
		local ang = (vec - me:GetShootPos()):Angle()
		
		-- Finally, set your view angles to the above angle.
		cmd:SetViewAngles(ang)
	end
end
-- CreateMove is the most reliable hook to use for aimbots.
hook.Add("CreateMove", "Prophunt Aimbot", PropAimbot)
Quote Originally Posted by Cyaegha View Post
this is pretty awful tbh
but at least it isn't another memeware release

Here's a better way of doing it
Code:
-- You only ever need to call this once, LocalPlayer will never change in-game.
local me = LocalPlayer()

local PropAimbot = function(cmd)
	-- Check if F is being pressed and you're on team "Hunters".
	if !(input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS) then return end
	
	-- If we make this global it might produce errors.
	local Target = nil
	-- Cache LocalPlayer's position, we don't need to call it every iteration in the loop.
	local MyPos, ShortestDistance = me:GetPos(), math.huge
	
	-- Loop through players on team "Props".
	for i, ply in ipairs(team.GetPlayers(TEAM_PROPS)) do
		-- If the player isn't alive then ignore them
		if !(ply:Alive()) then continue end
		
		-- Get the distance between LocalPlayer's position and ply's position.
		-- Use Vector:DistToSqr(OtherVector) for stuff like this, Vector:Distance(OtherVector) would be a waste of CPU cycles.
		local Distance = MyPos:DistToSqr(ply:GetPos())
		
		-- If Distance is smaller than ShortestDistance it means it's even shorter.
		if (ShortestDistance > Distance) then
			-- Make Target the player so we can use it later on.
			Target = ply
			-- Set ShortestDistance to the new shortest distance.
			ShortestDistance = Distance
		end
	end
	
	-- Target will be nil if the above loop doesn't find any targets and would throw errors.
	if (Target) then
		-- This would get the center of the target's model.
		local vec = Target:GetPos() + Target:OBBCenter()
		-- Get the angle pointing to the target.
		local ang = (vec - me:GetShootPos()):Angle()
		
		-- Finally, set your view angles to the above angle.
		cmd:SetViewAngles(ang)
	end
end
-- CreateMove is the most reliable hook to use for aimbots.
hook.Add("CreateMove", "Prophunt Aimbot", PropAimbot)
Thanks , this is way better than mine

QuickNote :
Code:
!(input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS)
would be better if u removed the parentheses , something like that
Code:
!input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS
because I don't want to run the code while I am a prop (otherwise it will aim to ground forever)
Quote Originally Posted by Zoal View Post
Code:
(!input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS)
would be better if u removed the parentheses , something like that
Code:
!input.IsButtonDown(KEY_F) or me:Team() ~= TEAM_HUNTERS
because I don't want to run the code while I am a prop (otherwise it will aim to ground forever)
In this case it doesn't matter if there are parenthesis, I just put them there because of a style preference.
So, how do I use this?
Quote Originally Posted by LynxPMC View Post
So, how do I use this?
copy and paste the code into a doc.txt and rename it to doc.lua or propaimbot.lua
use a bypasser like external2 or gDaap google those.
Good job on learning this stuff, sooner or later you will be much better at it!
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us