What should I do if I don't have a GUI after I have disabled it and re-enabled it?

what should I do if I don’t have a GUI after I have disabled it and re-enabled it?

How are you disabling/enabling the gui? Can you share your script?

just when I turn it off in the game and turn it on again there, it does not appear

I press Visible and it doesn’t appear

I think this might happen when you change the Visibility of GUI on the server and the client. This means you should change the GUI Visibility/Enabled Property either on the server or the client and you can’t choose both for the same UI.

Script – local camera = workspace.CurrentCamera
local sound = workspace[“elevator-music”]
local playButton = script.Parent.TextButton
local VsableButton = script.Parent.TextButton2

VsableButton.MouseButton1Click:Connect(function()

playButton.Visible = false




VsableButton.MouseButton1Click:Connect(function()

	playButton.Visible = true



end)

end)

it doesn’t work here

local camera = workspace.CurrentCamera
local sound = workspace[“elevator-music”]
local playButton = script.Parent.TextButton
local VsableButton = script.Parent.TextButton2

VsableButton.MouseButton1Click:Connect(function()
if playButton.Visible == true then

	playButton.Visible = false
	
	else


if playButton.Visible == false then
	
	playButton.Visible = true
	end
end

end)

WOW THIS WORKED

A better fix would be something like this:

local camera = workspace.CurrentCamera
local sound = workspace["elevator-music"]
local playButton = script.Parent.TextButton
local VisableButton = script.Parent.TextButton2

VisableButton.MouseButton1Click:Connect(function()
	playButton.Visible = not playButton.Visible
end)

Edit I fixed the sound.