Answered by
5 years ago Edited 5 years ago
You are using the wrong location to find the gui element, try this:
01 | local clickDetector = script.Parent |
02 | local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked |
03 | local player = game.Players.LocalPlayer |
05 | clickDetector.MouseClick:Connect( function (player) |
07 | brickClickedEvent:FireClient(player) |
08 | print (player.Name.. "has clicked the brick" ) |
09 | player.PlayerGui.TableFinder.Enabled = true |
Also, a more simple way to do it is to make the gui's visibility false. If you do that way, use this:
01 | local clickDetector = script.Parent |
02 | local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked |
03 | local player = game.Players.LocalPlayer |
05 | clickDetector.MouseClick:Connect( function (player) |
07 | brickClickedEvent:FireClient(player) |
08 | print (player.Name.. "has clicked the brick" ) |
09 | player.PlayerGui.TableFinder.Visible = true |