SolvedGmod aimbot

Posts 13 of 3 · Page 1 of 1
Gmod aimbot
Hello, My name is Hunter and i am trying to create an working aimbot for GMOD. I began by looking into how to script with lua and came up with this

function aimbot() -- Starting the function
local ply = LocalPlayer() -- Getting ourselves
local trace = util.GetPlayerTrace( ply ) -- Player Trace part. 1
local traceRes = util.TraceLine( trace ) -- Player Trace part. 2
if traceRes.HitNonWorld then -- If the aimbot aims at something that isn't the map..
local target = traceRes.Entity -- It's obviously an entity.
if target:IsPlayer() then -- But it must be a player.
local targethead = target:LookupBone("ValveBiped.Bip01_Head1") -- In this aimbot we only aim for the head.
local targetheadpos,targetheadang = target:GetBonePosition(targethead) -- Get the position/angle of the head.
ply:SetEyeAngles((targetheadpos - ply:GetShootPos()):Angle()) -- And finally, we snap our aim to the head of the target.
end
end
end
hook.Add("Think","aimbot",aimbot) -- The hook will spam "aimbot" until it finds a target..

Whenever i try to use this in game i cant get it to work...Any advice or tips?
Something in your SetEyeAngles is messed up, double check your script on the gmod wiki.
Code:
local function aimbot()
	local ply = LocalPlayer();
	local trace = util.GetPlayerTrace(ply);
	local traceRes = util.TraceLine(trace);

	if traceRes.HitNonWorld then
	local target = traceRes.Entity;

		if target:IsPlayer() then
			local targethead = target:LookupBone("ValveBiped.Bip01_Head1");
			local targetheadpos,targetheadang = target:GetBonePosition(targethead);

			ply:SetEyeAngles((targetheadpos - ply:GetShootPos()):Angle());
		end
	end
end
hook.Add("Think", "aimbot", aimbot)
there u go buddy 8)
- weed_head
Posts 13 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?