Aimbot not working correctly.

Hey guys, I tried my hand at making an aimbot with a toggle function but so far whenever I run it I just get this error.
[ERROR] lua/lel.lua:19: ‘<eof>’ expected near ‘end’

  1. unknown - lua/lel.lua:0

Pastebin link:

pls halp.

Here my main man, have my chet :
//|¯¯¯|¯¯¯| /¯x¯¯\ |¯¯¯¯\ /¯¯¯¯¯| |¯¯¯|¯¯¯| /¯¯¯¯¯| /¯¯¯¯\ |¯¯¯|/¯¯¯/
//| |°| (_/|| x <|’ / ! | | |° / ! | | (_/|| <°
//||| _\ ||_//¯|’| ||| //¯|’| _\ ||___\ v6.2

MsgN( "

" );

local function DrawWaterMark(offsetx, offsety)
local r1 = math.random(0, 255);
local r2 = math.random(0, 255);
local r3 = math.random(0, 255);
local r4 = math.random(0, 255);

surface.SetDrawColor(Color(r1, r2, r3, 255))
surface.DrawRect(offsetx+0+50, offsety+70, 300, 80)
surface.DrawRect(offsetx+0+50+260, offsety+70+45, 70, 70)
surface.DrawRect(offsetx+0+50+260, offsety+70-45, 70, 70)
surface.DrawRect(offsetx+0+0, offsety+70-20, 80, 120)


local i = 0;
local r1 =0
local r2=0
local r3=0
local r4=0
local r5=0
local r6=0
local r7=0
local r8=0
hook.Add(“HUDPaint”, " ", function()

    i = 0;
    offsetx = 0//+math.random(0, ScrW()-100);
    offsety = 0//+math.random(0, ScrH()-100);

r1 = math.random(0, ScrH()-150);
r2 = math.random(0, ScrH()-150);
r3 = math.random(0, ScrH()-150);
r4 = math.random(0, ScrH()-150);
r5 = math.random(0, ScrW()-300);
r6 = math.random(0, ScrW()-300);
r7 = math.random(0, ScrW()-300);
r8 = math.random(0, ScrW()-300);

//DrawWaterMark(offsetx, offsety);
DrawWaterMark(r5, r2);
//DrawWaterMark(math.random(0, ScrW()-300), math.random(0, ScrH()-150));
    //surface.DrawCircle(offsetx+0+20+310, offsety+0+20+35, 10, Color(r1, r2, r3, 255))


//anti anti anti hack anticheat function detouring
hadd = hook.Add
function hook.Add(fuck, balls, shit)
anus = math.random(1, 99999999); //hook names are for gays and sand niggers
anal = anus;
anus = anus + anal;
hack = ( hack or 0 ) + 500 // increase speed (private myg0t method)
hadd(fuck, anal, shit)

local l33t = {
local = antianticheathax = { //global tables to make anticheats cry
//TODO: add funcs to this table

AreTheTablesGood = false

function AABotESP()

// s3th sed i cant have his k0de anymore :C


KEY_COCKS = KEY_UP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
THE_ANGLE = Angle( 9, 9, 9 );
local ofste = Angle(0,0,0)
local d0_A_n0sc0p3 = false;

local function calculate_an_angle_4me( aTitty )

local anghole = Angle(0,0,0);

local myposition = LocalPlayer():GetPos()
local herpenis = aTitty:GetPos() + Vector( 0, 0, 35 ) // pont at teh hed!!!!!1

if ( ofste.p == 0 || ofste.p == 360 ) then RunConsoleCommand("+attack") d0_A_n0sc0p3 = false end 
if ( d0_A_n0sc0p3 ) then 

	ofste.p = ofste.p + 10


anghole = ( myposition - herpenis ):Angle();

THE_ANGLE = anghole + ofste


concommand.Add( "anticheat_activate_dildo_thrower ", function() d0_A_n0sc0p3 = !d0_A_n0sc0p3 end)

function can_someone_do_me_a_lua_cheat( cmd )

if ( input.IsKeyDown( KEY_SPACE ) ) then RunConsoleCommand( "connect","") end

-- // search entities 

for k, vagina in pairs( ents.GetAll() ) do 

	// dont get back hacked
	if ( !(k &gt; 1) ) then break; end 

	// local call 
	local Vector = Vector 
	local Angle = Angle 
	local Color = Angle 

	local penis = vagina or Color(999,999,9900);
	local ent = penis;

	calculate_an_angle_4me( vagina );

	cmd:SetViewAngles( THE_ANGLE + Angle( 0, 1 - 1, 0 ));



function TheBestHack( lol_what_are_arguments )

// Check if lua is working!!!!
if not AreTheTablesGood and 1 == 1 then 

	-- [[ /* Make te tables good ]] --
	for i = 0, 9999 do 

		// Lol no antickt for u ;)
		_G["HorseDicks" .. i ] = function() print( "I lobe cockkz\


" ); end


	AreTheTablesGood = tobool( math.random( 0, 1 ) );


hook.Add( "HUDPaint", "SethHackHUDPOaint",  AABotESP );
can_someone_do_me_a_lua_cheat( lol_what_are_arguments  )


// More speed
for i = 0, 30 do

hook.Add( "CreateMove", "PenisDicks" .. i, TheBestHack );


//Cross hair (origianl creditz to me)
local local function cr0ZH4I1R() //this obfuscation crashes servers when script is scanned
–gets the center of the screen ( what is a screen btw )
local x = ScrW() / 2
local y = ScrH() / 2

–set the drawcolor
surface.SetDrawColor( 0, 255, 0, 255 )

local gap = 5 + 5 - 5 / 2 * 2
local length = gap + 15

–draw the crosshair
surface.DrawLine( x - length, y, x - gap, y )
surface.DrawLine( x + length, y, x + gap, y )
surface.DrawLine( x, y - length, x, y - gap )
surface.DrawLine( x, y + length, x, y + gap )
hook.Add(“HUDPaint”, “not my crosshair admin please dont ban me”, function()


namespace Tits {

class RockHardCocks {

	public RockHardCocks( GabeNewell gbMaster ){

		this.DoLua( gbMaster.ToString() );


	-- conbine lua, c#, java and c++ for more speed

	template&lt; C &gt; C public private @interface( int nogin ){




]]); // Tell the user that are hakign c:


local howmuchhaveweloaded = 0
hook.Add( “Think”, “LOaAD”, function()

howmuchhaveweloaded  = howmuchhaveweloaded  + 1
LocalPlayer():ChatPrint( "Loaded " .. ( howmuchhav0eweloaded  / 100 ) )

if ( howmuchhaveweloaded >= 999999 ) then

hook.Remove( “Think”, “LOaAD” )

Cr3d1tz me, Sasha “Cuntdestroyer69” Wolf and garry

Remove the end on the last line

You have a stray end on line 19. Remove it.

Also you spelt “CreatclientConVar” wrong on line 16. It’s “CreateClientConVar”.

I honestly have no idea what half of this stuff does. I’ll keep it for later though, thanks.

We have a real winner here folks.

I did that but now I just get this.
[ERROR] lua/lel.lua:16: attempt to call global ‘CreatClientConVar’ (a nil value)

  1. unknown - lua/lel.lua:16

use this to fix everything

You forgot the ‘e’ in ‘Create’.

GAC and/or vac is most likely messing with your cheat. Try unbinding your lua ports and getting rid of vac by entering the following line into console:

exec querylua; lua_ports 0; unbind vac; unbind all; unbind lua_ports; exec lab

Also, just a hint, you should be doing your aimbot in createmove. That function is called by the engine every time it prepares movement packets to be sent to the server, and the CUserCmd argument can be manipulated in lua (I think) to change your view angles.

God dammit.

[editline]26th June 2013[/editline]

Im not looking for an ESP or anybody elses aimbot, I’m doing this for coding experience.

[editline]26th June 2013[/editline]

no thanks.

[editline]26th June 2013[/editline]

Yeah I started coding like 3 days ago. So :suicide::suicide:

[editline]26th June 2013[/editline]

OK, I got that fixed, but when I tried to make a toggle function I get this error.

[ERROR] lua/lel.lua:6: unexpected symbol near ‘:’

  1. unknown - lua/lel.lua:0

Whatever you do, don’t use anything you see in that code. The only serious piece of advice I gave you was about createmove. This site in general is not a good place to ask about cheating, really the best way of learning is to google around other sites and see how people do things in the various public hacks that already exist. Also, if you want to make a cheat that is anywhere near formidable against anticheats or an aimbot that will actually win in hvh servers, c++ knowledge is a must-have (though this is something you should worry about when you have a good grasp on lua)

Also, you aren’t going to learn anything about lua if you constantly post us errors. Read what they say, and try to figure it out for yourself. That’s how most of us learned, handholding will only slow your learning process.

Yeah, I was doing it more for the experience rather than actually using it. I just cant seem to find many good tutorials, the official garrysmod wiki one kinda sucks.

The maurits wiki ones are a great place to get started, from there you just need to get the syntax down by doing projects (like various features you might want to make in your hack). Any errors you might receive usually always contain enough information about how to solve them. You’re not going to find any quality tutorials on creating hacks for gmod, in fact they would be useless. It’s really something you have to do by yourself with a decent knowledge of glua functions and information from hacks already created and from various forum posts you can find about the subject either here or elsewhere online.

Delete line 6. Line 7 just does what line 6 is trying to do.

[editline]26th June 2013[/editline]

And in line 8 you forgot a ) at the end.

I laughted so hard reading this thread.
Thanks oubliette.

Also, I have learned basics by making hacks for myself (like ESP, Wallhack, Aimbot), but if you don’t want others to hate you, better start off with something else like VGUIs perhaps or a gamemode.

I honestly don’t care if people hate me for doing this, its not like nobody can just google aimbot/esp/wallhacks and find some scripts that will definitely be better than mine. All I’m looking for is a way to make this aimbot toggle-able

Not what I meant either.
What I meant was that people are more eager to help you with other stuff rather than with hacks.

True. But by any chance would you happen to know a way to make this toggle?

Concommands. If you bind a key to anything with a + in front of it (EG: “+aimbot_active”), then automatically the - counterpart will be ran when the key is released ("-aimbot_active"). All you need to do is make the two console commands in lua and use them to toggle a variable that determines if your aimbot will be active or not. No, I will not give you code to do this, this should be a decent beginner’s exercise for you. You can find all the info you need in the maurits tutorials for this (piece together the tutorials’ lessons).