READ: Overall this is a good script aside from the errors. First, this needs to be in a local script(which it is probably). Also, the main problem with the script is that you tried to get to the gui through startergui(a common mistake), if this is a local script(which it has to be to work and also you should always use localscripts for guis), then you can get to the player and their gui through: game.Players.LocalPlayer.StarterGui, the rest is exactly what is in startergui. Third of all, I put everything into a single mouseclick function to make it more simple. Basically, this edited version of your script activates a function that checks if it is either open or closed on mouseclick. Hope this helped :)
local ABOUTButton = script.Parent
local IsOpenBool = script.Parent.IsOpen
local function OpenorClose()
if IsOpenBool.Value == false then
game.Players.LocalPlayer.PlayerGui.ScreenGui.MENU.ABOUTBACKROUND.Visible = true
IsOpenBool.Value = true
end
elseif IsOpenBool.Value == true then
IsOpenBool.Value = false game.Players.LocalPlayer.PlayerGui.ScreenGui.MENU.ABOUTBACKROUND.Visible = false
end
end
ABOUTButton.MouseButton1Click:Connect(OpenorClose)
Note: There may be minor typing mistakes in the script
1 comment
When changing a bool's value, you can't say IsOpenBool.Value == true, you will have to say IsOpenBool == true. I know it sounds strange, but it worked for me.