I was just wondering if there was a way to find out who clicked on the click detector?
The correct way to see who clicked it:
1 | local function onMouseClick(player) |
2 | print ( 'player who clicked is ' .. player.Name) |
3 | end |
4 | clickDetector.MouseClick:connect(onMouseClick) |
If you include player
in the mouse click function, roblox automatically fills that in with the person (located in players) who clicked it.