What I'm trying to do is when the player clicks a brick a GUI in the corner of there screen will add by 1
The number is not changing and there is no error in the output
Count = 0
Collect = script.Parent
function OnClicked()
Count = Count + 1
game.StarterGui.ScreenGui.TextLabel.Text = Count
end
Collect.ClickDetector.MouseClick:Connect(OnClicked)

2 comments
Items in StarterGui that are modified with a script will only be seen after the player respawns. You may have to make a RemoteEvent that fires a LocalScript to change the number on the client's side right away.
maybe you need to add the PlayerWhoClicked parameter in your function since it's required for the MouseClick event?