This event fires when a user begins interacting with the
GuiObject via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).
UserInputService has a similarly named event that is not restricted to a specific UI element:
This event will always fire regardless of game state.
Tracking the Beginning of Input on a GuiObject
The following example demonstrates one of many usage examples of handling user input from InputBegan depending on its type.
In order for this to work as expected, it must be placed in a
LocalScript and a child of gui.