I am coding a computer in roblox studio where on the monitor there is a login button and I want it where when a player hit that button a frame from my screengui. Ive been trying different codes but none worked. Mt recent script was a script. (I tried both local and normal script of this code both didnt work.) this script is in the button of the surfacegui.
<code>local MyButton = script.Parent
local frame = game.StarterGui.ScreenGui.Frame
MyButton.MouseButton1Click:Connect(function()
frame.Visible = true
end)[[enter image description here](https://i.sstatic.net/DHLgwZ4E.png)](https://i.sstatic.net/TMWlbZBJ.png)
</code>
<code>local MyButton = script.Parent
local frame = game.StarterGui.ScreenGui.Frame
MyButton.MouseButton1Click:Connect(function()
frame.Visible = true
end)[[enter image description here](https://i.sstatic.net/DHLgwZ4E.png)](https://i.sstatic.net/TMWlbZBJ.png)
</code>
local MyButton = script.Parent
local frame = game.StarterGui.ScreenGui.Frame
MyButton.MouseButton1Click:Connect(function()
frame.Visible = true
end)[[enter image description here](https://i.sstatic.net/DHLgwZ4E.png)](https://i.sstatic.net/TMWlbZBJ.png)
I tried making the code where when button is pressed it would make frame visible.
New contributor
Andrew N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1