How to check for player's mouse down.

The only way I know to do this is input.IsMouseDown, but is the “input” just the entity or player that I want to check if the mouse is down on? Sorry if it is a stupid question.

That’s what I said in the post, dude. I just want to know how to use it! Is it something like entity:IsMouseDown(), or is it something completely different? It does not clarify as far as I could tell, and that’s what I want to know.

No. Its is run client side, And you should use it in a think hook. It will return true when called if the mouse is down or false if not.

So, something like this?


function SWEP:Think()
    while IsMouseDown() do
         --whatever
    end
end


function SWEP:Think()
    if (CLIENT) then
        if (input.IsMouseDown()) then
             --whatever
        end
    end
end

Thank you!