When I click it, it won't work :/
function onClick() if game.StarterGui.ScreenGui.Frame.Visible ==false then game.StarterGui.ScreenGui.Frame.Visible = true else game.StarterGui.ScreenGui.Frame.Visible = false end end script.Parent.MouseButton1Click:connect(onClick)
No ideas anymore help would be... well helpful :b
Don't use the StarterGui, use this:
game.Players.LocalPlayer.PlayerGui
Since this is a Gui, you should usually use a LocalScript as it prevents server lag from the Gui, and it is only happening for that Player.
Now, a better way to do this would be to connect the function right away, like so:
script.Parent.MouseButton1Click:connect(function() end)
Doing this can save a line, and a bit of time.
Your next error would be that you are going to the StarterGui instead of the PlayerGui, which can be done as so:
Player = game.Players.LocalPlayer PGui = Player.PlayerGui
Everything else looks fine, good luck!