Problem whit aimbot script

Posts 1–5 of 5 · Page 1 of 1
Problem whit aimbot script
so i have tried making an aimbot whit toggle in lua for gmod but the script gives an error:

[ERROR] lua/ls.lua:16: 'end' expected (to close 'function' at line 1) near '<eof>'
1. unknown - lua/ls.lua:0

 
script

function aimbot()
CreateClientConVar( "aa_enabled", 0, true, false )
if ConVarExists( "aa_enabled" ) and GetConVar("aa_enabled"):GetInt() == 1 then

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)
Thanks in advance (the Part of the text taht is bold is creating the errors i suppose?)
Code:
function aimbot()
CreateClientConVar( "aa_enabled", 0, true, false )
if ConVarExists( "aa_enabled" ) and GetConVar("aa_enabled"):GetInt() == 1 then
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
end
hook.Add("Think","aimbot",aimbot)

There you go bud, all fixed up for you.
Quote Originally Posted by iMythik View Post
Code:
function aimbot()
CreateClientConVar( "aa_enabled", 0, true, false )
if ConVarExists( "aa_enabled" ) and GetConVar("aa_enabled"):GetInt() == 1 then
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
end
hook.Add("Think","aimbot",aimbot)

There you go bud, all fixed up for you.
Hell yeah THANKS
btw is there any way to make this aim a little bit higher? its annoying that it aims at the neck when behind ppl :C
That is the head, it's just the model's are hunched over all the time
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us