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

How Do You Find Out Who Clicked A ClickDetector?

I Know This Is Probably A Easy Solution But I Want To Know For Something I'm Testing. I Want To Find Out Who Clicked My Button But I Can't Think Of A Way To Do It. I Know It's Probably Easy But I Want To Know. Example: local function OnClicked() game.Workspace.{Insert Player Name}.Head:Remove() end

1 answer

The onclick event has a playerWhoClicked parameter. More Details here: http://wiki.roblox.com/index.php?title=API:Class/ClickDetector/MouseClick

4 comments

0

I Would Think This Should Work But It Isn't

0

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked) game.Workspace.playerWhoClicked.Name.Head:Remove() end)

0

just do playerwhoclicked.Name.Head:Remove(). You dont need anything before it.

0

okay

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