How can I detect the person that clicks the ClickDetector brick?
This is what I thought but I was wrong...
1 | local owner = script.Parent.Parent.Parent.Parent.OwnerName.Value |
2 | function onClicked(owner) |
The MouseClick event in a ClickDetector yields an argument for the player who clicked the brick. Example-
1 | detect = script.Parent.ClickDetector |
2 |
3 | detect.MouseClick:connect( function (player) |
4 | player.TeamColor = BrickColor.new( "Bright blue" ) |
5 | end ) |