Welcome UI not working with no errors

Hello
I am trying to make a welcome Ui which opens 2 seconds after someone joins. (that part will be added later I just kept it simple for now.

The first problem I ran into is that the Ui does not appear, without an error.
The second problem is that the “closes in …” part does not change.
I’m outta options I don’t know what I did wrong.

local welcome = game.StarterGui.WelcomeFrame

wait(3)

welcome.Enabled = true
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (3)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (2)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (1)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (0)"
wait(1)
welcome.Enabled = false

The script is in StarterGUI and it is a local script.

perhap, :sweat_smile:

--when the player joins the game all gui inside the game.StarterGui will replicate to player.PlayerGui

local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local welcome = PlayerGui:WaitForChild("WelcomeFrame")

wait(3)

welcome.Enabled = true
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (3)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (2)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (1)"
wait(1)
welcome.MainFrame.CloseFrame.TextLabel.Text = "Closes in (0)"
wait(1)
welcome.Enabled = false

thank you so much i forgot about the local player part

1 Like
local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local welcome = PlayerGui:WaitForChild("WelcomeFrame")

local CountDownStart = 3

wait(3)

welcome.Enabled = true

for i = CountDownStart,0,-1 do
	welcome.MainFrame.CloseFrame.TextLabel.Text = "Closing in ("..i..")"
	
	wait(1)
	
	if i == 0 then
		welcome.Enabled = false
	end
end
local welcomeFrame = script.Parent
task.wait(3)
welcomeFrame.Enabled = true
for i = 3, 0, -1 do
	task.wait(1)
	welcomeFrame.MainFrame.CloseFrame.TextLabel.Text = "Closes in ("..i..")"
end
welcomeFrame.Enabled = false

Local script, place it inside the WelcomeFrame.