or maybe you could just look at this first https://pastebin.com/FP7qjjVZ
also use code tags
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!
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)
Last edited by ryanlaucek; 03-23-2015 at 11:42 AM.
or maybe you could just look at this first https://pastebin.com/FP7qjjVZ
also use code tags
After studying the aimbot I had a couple questions, Please bare with me here as I am pretty novice at lua, but trying to learn.
1. What would I have to change to make it work in my menu
2. No one has ever really explained simply how/when to use args, I've always had help with them, but i've decided to come here instead of asking my friends.
yeah well this is terrible, but whatever help the idiots
most likely this is what i would do
then you can delete your other 2 functions and make a better aimbot, also please dont use gdaapCode:local aimkey = CreateClientConVar("aimkey", 0, true, false)
nice meme dude, anyway something like this: http ://pastebin. com/3zeAGSwU
download hac booty and reference from there: http ://fastdl.unitedhosts. org/hac/
Fixed your error here you go
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.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","ak",aimkey) 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)
Last edited by suchisgood; 03-24-2015 at 07:13 AM.