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

Detecting who clicks?

How can I detect the person that clicks the ClickDetector brick?

This is what I thought but I was wrong...

local owner = script.Parent.Parent.Parent.Parent.OwnerName.Value
function onClicked(owner)

1 answer

The MouseClick event in a ClickDetector yields an argument for the player who clicked the brick. Example-

detect = script.Parent.ClickDetector

detect.MouseClick:connect(function(player)
	player.TeamColor = BrickColor.new("Bright blue")
end)

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