Thread: Quick LUA Help

Results 1 to 13 of 13
  1. #1
    ryanlaucek's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cool

    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!

    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.

  2. #2
    razor_''s Avatar
    Join Date
    Nov 2014
    Gender
    male
    Location
    inside frekkinnoob
    Posts
    46
    Reputation
    10
    Thanks
    107
    My Mood
    In Love
    or maybe you could just look at this first https://pastebin.com/FP7qjjVZ

    also use code tags

  3. #3
    ryanlaucek's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cool
    Quote Originally Posted by razor_' View Post
    or maybe you could just look at this first <link>

    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.

  4. #4
    max1612's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Location
    C:/Users
    Posts
    532
    Reputation
    18
    Thanks
    1,466
    Quote Originally Posted by razor_' View Post
    or maybe you could just look at this first https://pastebin.com/FP7qjjVZ

    also use code tags
    since when are you black
    Empty for now

  5. #5
    kingboy111's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    103
    My Mood
    Sneaky
    think aimbot

    o hot damn

  6. #6
    x0ger_'s Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    3
    yeah well this is terrible, but whatever help the idiots
    most likely this is what i would do
    Code:
    local aimkey = CreateClientConVar("aimkey", 0, true, false)
    then you can delete your other 2 functions and make a better aimbot, also please dont use gdaap

  7. #7
    ryanlaucek's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cool
    Quote Originally Posted by x0ger_ View Post
    yeah well this is terrible, but whatever help the idiots
    most likely this is what i would do
    Code:
    local aimkey = CreateClientConVar("aimkey", 0, true, false)
    then you can delete your other 2 functions and make a better aimbot, also please dont use gdaap
    Spare me.. As i've mentioned twice before i'm extremely new to lua, so hop off

    //dicktoolong

  8. #8
    x0ger_'s Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    3
    nice meme dude, anyway something like this: http ://pastebin. com/3zeAGSwU
    download hac booty and reference from there: http ://fastdl.unitedhosts. org/hac/

  9. #9
    suchisgood's Avatar
    Join Date
    Feb 2014
    Gender
    female
    Posts
    902
    Reputation
    10
    Thanks
    560
    My Mood
    Angelic
    Quote Originally Posted by ryanlaucek View Post
    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)
    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.

  10. #10
    ryanlaucek's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cool
    Quote Originally Posted by suchisgood View Post
    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)
    I only had to remove 1 end? :0

  11. #11
    suchisgood's Avatar
    Join Date
    Feb 2014
    Gender
    female
    Posts
    902
    Reputation
    10
    Thanks
    560
    My Mood
    Angelic
    Quote Originally Posted by ryanlaucek View Post
    I only had to remove 1 end? :0
    Nope you was missing a ) at chat. and print, you was forgot to remove 1 end also traceRes. didn't have Entity on the end, I could go on, Quite alot of things you had wrong!

  12. #12
    ryanlaucek's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Cool
    Quote Originally Posted by suchisgood View Post
    Nope you was missing a ) at chat. and print, you was forgot to remove 1 end also traceRes. didn't have Entity on the end, I could go on, Quite alot of things you had wrong!
    Thanks c: I'm making a hack with a derma menu with sliders and stuff, which is a bit out of my comfort zone, Would you be able to add me on steam and answer some questions if i have any?

  13. #13
    suchisgood's Avatar
    Join Date
    Feb 2014
    Gender
    female
    Posts
    902
    Reputation
    10
    Thanks
    560
    My Mood
    Angelic
    Quote Originally Posted by ryanlaucek View Post
    Thanks c: I'm making a hack with a derma menu with sliders and stuff, which is a bit out of my comfort zone, Would you be able to add me on steam and answer some questions if i have any?
    Use mpgh, I'm sure some skids can help you, Aswell as a pro here!

Similar Threads

  1. quick gun help
    By deadskulz in forum Combat Arms Discussions
    Replies: 3
    Last Post: 03-22-2011, 09:00 PM
  2. Quick question/help
    By Ryguy in forum Help & Requests
    Replies: 11
    Last Post: 02-25-2011, 02:41 PM
  3. [SOLVED]Banned, quick question, help please.
    By tapout26 in forum Call of Duty Modern Warfare 2 Help
    Replies: 7
    Last Post: 11-12-2010, 12:51 PM
  4. Windows 7 Quick Installation Help?
    By Th3KaNgSt3R in forum Suggestions, Requests & General Help
    Replies: 1
    Last Post: 03-19-2010, 05:14 PM
  5. Quick mod help> files wont inject
    By snekysnake in forum Combat Arms Mods & Rez Modding
    Replies: 0
    Last Post: 01-02-2010, 03:55 PM