You’re referencing and modifying a GUI through StarterGui, and not the PlayerGui. Whenever a player joins the game, all descendants of StarterGui are cloned and parented into PlayerGui. When scripting GUI for a player, you must always script their PlayerGui. You can reference this hierarchy from a local script as such:
local player = game:GetService("Players").LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
Edit: Your use case would look something like this:
local player = game:GetService("Players").LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local Button = script.Parent
local Frame = playerGui.ScreenGui.Frame
Button.MouseButton1Click:Connect(function()
Frame.Visible = true
end)