Just a Small Problem.

I’m working on this code to basically have a team selection menu and I have a error.

Error:


[ERROR] gamemodes/frightnight/gamemode/cl_init.lua:63: function arguments expected near '='
  1. unknown - gamemodes/frightnight/gamemode/cl_init.lua:0


Here is the line (first line is 63):


close_button:DoClick = function()
	TeamMenu:Close()
end

I’m confused, is there arguments I’m missing. I thought this is a way to make a close button close when you press it.

Thanks, in advance I’m new to GLua.

Try using this instead.


close_button.DoClick = function()

Calling :DoClick makes the code expect you to run the function. You want to override close_button.DoClick with a new function.

Well, I don’t see what you typed differently but I tried


close_button:DoClick = function()
end

and without end and still same problem proceeds.

EDIT:

My dumbass didnt see the dot instead of :

----- Now I’m getting a different error. But I’ll try to figure it out. Thanks so much!