Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Who clicked the click detector?

Asked by
gdunn2 54
10 years ago

I was just wondering if there was a way to find out who clicked on the click detector?

1 answer

Log in to vote
2
Answered by 10 years ago

The correct way to see who clicked it:

local function onMouseClick(player)
print('player who clicked is ' .. player.Name)
end
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.

Ad

Answer this question