fireclickdetector
Fires a ClickDetector as if the player clicked it.
function fireclickdetector(detector: ClickDetector, distance: number?, event: string?): ()Synopsis
How it works
Bypasses the Roblox client's input processing pipeline and directly invokes the
ClickDetector's internal activation method. This fires the MouseClick (or RightMouseClick) signal on the detector, which replicates to the server as a legitimate interaction. The distance parameter fakes the click distance check.Under the hood
A ClickDetectorClickDetectorA Roblox Instance placed inside a BasePart that fires MouseClick/MouseHoverEnter/MouseHoverLeave signals when the player interacts with the part. fireclickdetector() simulates these interactions. normally requires:
- Mouse hover within
MaxActivationDistance - A genuine mouse input event from the OS
- Raycasting to verify line-of-sight
fireclickdetector skips all of these and directly fires the detector's internal signal, causing the server to process it as a real click. The server has no way to distinguish this from a real interaction.Usage
Click a door detector
local detector = workspace.Door.ClickDetector
fireclickdetector(detector)Parameters
detector ClickDetector The ClickDetector instance to fire.
distance number optionalSimulated click distance (default 0).
event string optional"MouseClick" (default) or "RightMouseClick".