script.Parent.MouseButton1Click:Connect(function(plr)
if game.StarterGui.atm.atm.Visible == false then do
game.StarterGui.atm.atm.Visible = true
end
end
end)
Why isn’t this script making the frame visible? This is a local script located within a Surface Gui’s Text Button.
Okay, so a TextButton can’t function inside a part, it must be inside the StarterGui. To do this, you can place the SurfaceGui inside the StarterGui and have the SurfaceGui’s Adornee connected to the part. Like so:
Also, your script has a slight problem. When playing the game, the StarterGui is not what a player uses. They have their own copied set of Gui’s inside their Player which you can find in Players. Here’s the fixed version of your code:
script.Parent.MouseButton1Click:Connect(function(plr)
if plr.PlayerGui.atm.atm.Visible == false then
plr.PlayerGui.atm.atm.Visible = true
end
end)
Here, I replaced game.StarterGui with plr.PlayerGui because we’re looking for the player’s own set of gui’s, not the server’s.