How do I get this frame to disappear when in menu screen?

So I have a menu screen for my game and I want to make it so that this top bar isn’t visible when your in the menu screen. Ive tried both scripts below on local and server script and it didn’t work, what should I do?


This is one of the scripts I’ve tried.

local F3 = ("Frame3")
local M = ("MoneyDisplayFrame")
local F = ("Frame1")

if  F.Visible == true then
	M.Visible = false
	F3.Visible = false
end

I’ve also tried

local T = ("TopBar")
local M = ("Menu")

if M.Enabled == true then 
T.Enabled = false
end

Those conditional statements will only run once when each script first executes, you’ll need to wrap them inside loops.

Make sure you add wait() or task.wait() to each loop so Roblox doesn’t crash due to exhaustion.

How would I loop it? sorry im fairly new.

You would have to loop the script over and over again.

while true do
wait()
-- your script
end

Tried this and it didn’t work. I tried it on both server and local script.

local F3 = ("Frame3")
local M = ("MoneyDisplayFrame")
local F = ("Frame1")

while true do
	wait()
	if  F.Visible == true then
		M.Visible = false
		F3.Visible = false
	end
end

Same here

local T = ("TopBar")
local M = ("Menu")

while true do
	wait()
	if  M.Enabled == true then
		T.Enabled = false
	end
end