I have added a surface gui to my lobby to show up only when the round is in progress so that you ca spectate from there. But I want both gui to go away after the round ends. Is there a simpler way to do this ?

This is my script so that the surface gui only shows up when the round is in progress

--MAde by 1Messi3903
plr = game.Players.LocalPlayer
status = game.ReplicatedStorage.InfoValue.Value


i = 120, 0, -1
	if status==i..' seconds remaining!' then
	script.Parent.Enabled = true
	else
		script.Parent.Enabled = false
	end

This is my script to make the spectate gui go away when in intermission or not enough players

--MAde by 1Messi3903
plr = game.Players.LocalPlayer
status = game.ReplicatedStorage.InfoValue.Value

function intermissionCheck()
	i = 90, 0, -1
	if status=='Intermission '..i then
	script.Parent.Enabled = false

	end
end

function noPlayersCheck()
	if status=='There needs to be 2 or more players to begin' then
	script.Parent.Enabled = false
	end
end

4 comments

0

is this a normal or local script

0

and what is the problem?

0

It is normal script and the problem is that it doesnt make the GUI appear when the round starts or go away when the round ends

0

You could set a part to change color to black when the round starts and white when the round ends. Have it check the part's color in a while true do loop.