Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to detect who clicked a ClickDetector?

I want to put a cooldown on their clicking, and obviously I need to know who clicked something. Is there a certain function, or do I do something with the parameter?

1 answer

✓ Accepted answer

A ClickDetector has the event MouseClick which passes the player who clicked it.

This is the example from the wiki:-

Workspace.Part.ClickDetector.MouseClick:connect(function(playerWhoClicked)
  print("Part was clicked by: " .. playerWhoClicked.Name)
end)

I hope this helps.

1 comment

0

Thanks, didn't know it was something with the parameter or the function.

This discussion is preserved as it was. New answers, comments, and votes are closed.