✓ Accepted answer
You are using the wrong location to find the gui element, try this:
local clickDetector = script.Parent
local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked
local player = game.Players.LocalPlayer
clickDetector.MouseClick:Connect(function(player)
if not false then
brickClickedEvent:FireClient(player)
print(player.Name.. "has clicked the brick")
player.PlayerGui.TableFinder.Enabled = true
end
end)
Also, a more simple way to do it is to make the gui's visibility false. If you do that way, use this:
local clickDetector = script.Parent
local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked
local player = game.Players.LocalPlayer
clickDetector.MouseClick:Connect(function(player)
if not false then
brickClickedEvent:FireClient(player)
print(player.Name.. "has clicked the brick")
player.PlayerGui.TableFinder.Visible= true
end
end)