Button won't work

Hello!
I’m making a button so players can go back to menu through it, however, it didn’t work. Here are scripts:

script.Parent.MouseButton1Click:Connect(function()

game.StarterGui.menu.Enabled = true

end)

Here is picture of explorer image

Can I have some advice, please?

You can’t use the StarterGui cause it is used before the game is executed. You can consider it a storage for all the GUIs that will go inside the PlayerGui, which is what you’re looking for.

script.Parent.MouseButton1Click:Connect(function()
   game.Players.LocalPlayer.PlayerGui.menu.Enabled = true
end)
4 Likes

Thank you for help! It worked!

1 Like