It's not recommended to implement this function in luau. Doing so will expose you to easy detections.
Triggers a specified event on a ClickDetector. The event parameter defaults to MouseClick if not defined. Not providing the distance will default to infinite.
function fireclickdetector(object: ClickDetector, distance: number?, event: string?): ()
distance - Distance to trigger the ClickDetector from.
event - The chosen event to trigger the detector with.
Examples
local ClickDetector = Instance.new("ClickDetector")
ClickDetector.MouseClick:Connect(function()
print("Fired")
end)
fireclickdetector(ClickDetector, 32) -- This will not output