Quick LUA Help
Hey, I'm somewhat new to lua, and I've been making my own hack over the past few days with help from a couple friends and I've usually been able to fix my own errors, but this one has got me stumped, I've been trying to make a very basic aimbot into an aimkey, so whenever I click enable aimkey in my menu, and hold F, it would do as an aimbot would. The problem I'm having is this: [gDaap Bypasser] [ERROR] Error loading Lua code into buffer (Syntax Error)[lua/includes/init.lua:541: '<name>' expected near 'if']
line 541 is the if target:IsPlayer() line. but since I'm quite new I don't know how to fix this. Thanks for your time everyone!
line 541 is the if target:IsPlayer() line. but since I'm quite new I don't know how to fix this. Thanks for your time everyone!
Code:
function aimkey()
if input.IsKeyDown(KEY_F) then
local ply = LocalPlayer()
local trace = util.GetPlayerTrace( ply )
local traceRes = util.TraceLine( trace )
if traceRes.HitNonWorld then
local target = traceRes.
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
end
hook.Add("Think","aimbot",aimbot)
local function aimkeyON()
print("Hold F for Aimbot")
chat.AddText( Color( 255, 127, 0), "Hold F for Aimbot")
hook.Add("Think","ak",aimKey)
end
concommand.Add("trekt_aimkey_enable",aimkeyON)
local function aimkeyOFF()
print("AimKey Disabled"
chat.AddText( Color( 255, 127, 0), "AimKey Disabled"
hook.Remove("Think","ak")
end
concommand.Add("trekt_aimkey_disable",aimkeyOFF)
