Gamemode "function arguments" not working.

Hi there guys

I’ve wanted to learn lua for ages now, and I’ve finally thought about doing it now, and i’ve plunged myself into the gamemode part of it, yes I know your spose to have a decent knowlodge of lua and blah blah blah, but I thought if maybe I do this then I’ll learn it quicker and how the bits work

Well my problem is that in the gamemode i’ve done, I got the skeleton part from and then I found a tutorial on the Gmod wiki, the guy who wrote it even said it might not work due to him not having tested it because of him not having Gmod

Now it keeps saying that it won’t load due to line 18 can any of you guys see what is wrong and help a newbie coder out


team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) -- Placing it half way on the tall and 5 units in the horizontal
team_1:SetSize( 300, 300)
team_1:SetText( "Guest" )
team_1:DoClick function()
	RunConsoleCommand( "team_1" )


Sorry, line 18 is where it has the DoClick function

team_1.DoClick = function()


Ok, I put that into it but I still get this error in the console with it not loading up

WTF!/gamemode/cl_init.lua:18: function arguments expected near ‘=’

team_1.DoClick() = function()

Just tried that too, again still the same error message as before

I appricate the help you guys are giving me though =]

One thing,

SetPos(Horizontal , Vertical)

It’s the same with SetSize(w , h)

Ahh okies thanks, Anybody got any ideas on what the fault is though with line 18?


Anyone at all?


RunConsoleCommand( “team_1” );


Thanks Horsey! Thats worked perfect

now just gotta worry about the other lua errors :stuck_out_tongue:

What other errors?


once you understand Errors they are easy to fix