Click Counter?

Hi i was just wondering how you mould make a gun so it only fired when you clicked and if you held it down it would fire once.
Any ways to do that?

EDIT: Oh yeah it doesn’t have to be a gun it can be just anything that you have to click each time you want it to do something like a click counter each time you click it counts up by 1

Well, let’s look at this from the logic perspective. How does the BGE event layer determine the difference between a held click and a single click? In the Python api, there are different values for keyboard events, so you can simply check those, but, for logic bricks, it is a little more complex (only a little!). As I’ve explained recently, logic bricks have two states: positive and negative, and then there is triggering. Well, keyboard sensors and mouse sensors will easily allow you to fire “once” until released. This is because, when no pulse mode is enabled, the sensor only triggers the controller when it changes state. This only happens when it is first pressed and then released. So a simple setup of: Mouse -> And -> Actuator would suffice.

oh yeah Thanks