Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make these 3 buttons disappear and make an About GUI?

Asked by 8 years ago

DISCLAIMER: My real account is DragonBallFan100. The reason I made this account is because the code to verify my account kept getting blocked because I'm under 13, and I do not want to wait 2 more years.

ANYWAY:

I have 3 buttons on a main menu. The main menu (Frame) is black, and I have 3 buttons on it.

Play, About, and Help.

I want to click About, and make those 3 buttons disappear, and make ANOTHER GUI take the 3 buttons place, and when I click back, I want the About Menu GUI to disappear, and for the 3 buttons to come back. Here's what I tried.

About = game.StarterGui.MainMenu.Frame.About
Play =  game.StarterGui.MainMenu.Frame.Play
Help =  game.StarterGui.MainMenu.Frame.Help

function(about)
         About.Visible = false
         Play.Visible = false
         Help.Visible = false
          AboutMenu.Visible 
end

game.StarterGui.MainMenu.Frame.About.MouseButton1Down:connect(about)

What is wrong with this code?

0
I realized I made a mistake in the code. On line 9, I should have done = true. learntolua101 3 — 8y
0
Updated my answer. TheHospitalDev 1134 — 8y
0
Still won't work. learntolua101 3 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Put this in a LocalScript

What you did wrong You were defining "StarterGui". The service which will only update when a player joins or respawns. You wanted "PlayerGui"

How to fix it

local player = game.Players.LocalPlayer
local frame = player:FindFirstChild("MainMenu"):FindFirstChild("Frame")
local About = frame.About
local Play =  frame.Play
local Help =  frame.Help

About.MouseButton1Down:connect(function()
         About.Visible = false
         Play.Visible = false
         Help.Visible = false
end)
0
Sorry, the answer didn't help. learntolua101 3 — 8y
0
What errors are you getting? TheHospitalDev 1134 — 8y
0
It just won't work. :/ I put it in a local script. And still, nothing. learntolua101 3 — 8y
0
Any errors? Or just nothing? TheHospitalDev 1134 — 8y
View all comments (4 more)
0
Just nothing. learntolua101 3 — 8y
0
WAIT THERE IS ONE ERROR Players.DragonBallFan100.PlayerGui.MainMenu.Frame.LocalScript:2: attempt to index a nil value learntolua101 3 — 8y
0
Try it now. TheHospitalDev 1134 — 8y
0
Nothing :( learntolua101 3 — 8y
Ad

Answer this question