MOUSE_LEFT won't work properly why ?

[lua]if CLIENT then

function MousePressed(mc)

 if input.IsMouseDown(MOUSE_LEFT) then 

LocalPlayer():ConCommand( “AClip1” )
end
end
hook.Add(“Think”, “Checkwhenclicked”, MousePressed);

end

if SERVER then

function AClip(ply, cmd, args)

local client = ply

client:GetActiveWeapon():SetClip1( 255 )

end
concommand.Add(“AClip1”, AClip)

end[/lua]


I try to activate my ConCommand with MOUSE_LEFT trigger but noting work, some one have an idea ?

[lua]if CLIENT then

local function MousePressed(mc)

if (mc == MOUSE_LEFT)  then
	 LocalPlayer():ConCommand("AClip1");
end

end
hook.Add(“GUIMousePressed”, “Check when clicked”, MousePressed);

end

if SERVER then

function AClip(ply, cmd, args)

local client = ply

ply:GetActiveWeapon():SetClip1( 255 )

end
concommand.Add(“AClip1”, AClip)

end

[/lua]

error?
try to remove local on the first function and remove spaces in the hook name
so hook.Add(“GUIMousePressed”, “Check when clicked”, MousePressed);
will be
hook.Add(“GUIMousePressed”, “Checkwhenclicked”, MousePressed);

That isn’t the problem.

There is no error but I tested what you said but nothing happening.

I want to activate each time SetClip1() when I press MOUSE_LEFT

Edit: Oops GUI.MousePressed it’s when I see the cursor ( damn :frowning: ) any alternative for when IsFiring ?