How to make a notice in this script?

Sorry if the title didn’t make sense, I don’t know how to word it.

Basically I have this script made by @UseCode_Tap (TheDevKing) and I was wondering how to add a part before the roundLength countdown show the countdown to how long until you get your sword.

local roundLength = 180

I tried adding a wait at

local function roundTimer()
   while wait() do -- I tried adding a  wait(5) here
   	for i = intermissionLength, 1, -1 do
   		InRound.Value = false
   		wait(1)
   		Status.Value = "Intermission: ".. i .." seconds left!"
   	end
   	for i = roundLength, 1, -1 do 
   		InRound.Value = true
   		wait(1) -- I tried adding a  wait(5) here
   		Status.Value = "Game: ".. i .." seconds left!"
   	end
   end
end

But that just bugged it out.

Whole script
local roundLength = 180
local intermissionLength = 20
local InRound = game.ReplicatedStorage.Values.InRound
local Status = game.ReplicatedStorage.Values.GameStatus

local swordCount = false

local LobbySpawn = game.Workspace.LobbyTeleport
local GameAreaSpawn = game.Workspace.GameTeleport

InRound.Changed:Connect(function()
	wait(1)
	if InRound.Value == true then
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
			swordCount = true
			Status.Value = "You will be receiving your swords in 5 seconds"
			wait(1)
			Status.Value = "You will be receiving your swords in 4 seconds"
			wait(1)
			Status.Value = "You will be receiving your swords in 3 seconds"
			wait(1)
			Status.Value = "You will be receiving your swords in 2 seconds"
			wait(1)
			Status.Value = "You will be receiving your swords in 1 seconds"
			wait(1)
			Status.Value = "Fight!"
			local sword = game.ReplicatedStorage.Tools.Sword:Clone()
			sword.Parent = player.Backpack
		end
	else
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
			player.Backpack.Sword:Destroy()
		end
	end
end)


local function roundTimer()
	while wait() do
		for i = intermissionLength, 1, -1 do
			InRound.Value = false
			wait(1)
			Status.Value = "Intermission: ".. i .." seconds left!"
		end
		for i = roundLength, 1, -1 do
			InRound.Value = true
			wait(1)
			Status.Value = "Game: ".. i .." seconds left!"
		end
	end
end

spawn(roundTimer)

Reason why the script above doesn’t work: The bottom of the script where the roundTimer function is over-writes the Status.Value before the “SwordCountdown” finishes.

Hello @SimplyFrazer,

You would want to do something similar to what I have done here. The way your current full code is setup, it would wait each time it tries to give a player a tool.

local roundLength = 180
local intermissionLength = 20
local InRound = game.ReplicatedStorage.Values.InRound
local Status = game.ReplicatedStorage.Values.GameStatus

local swordCount = false

local LobbySpawn = game.Workspace.LobbyTeleport
local GameAreaSpawn = game.Workspace.GameTeleport

InRound.Changed:Connect(function()
	wait(1)
	if InRound.Value == true then
		for i = 5,1, -1 do
			Status.Value = "You will be receiving your swords in " .. i .. " seconds"
			wait(1)
		end
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
			swordCount = true
			local sword = game.ReplicatedStorage.Tools.Sword:Clone()
			sword.Parent = player.Backpack
		end
	else
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
			player.Backpack.Sword:Destroy()
		end
	end
end)


local function roundTimer()
	while wait() do
		for i = intermissionLength, 1, -1 do
			InRound.Value = false
			wait(1)
			Status.Value = "Intermission: ".. i .." seconds left!"
		end
		for i = roundLength, 1, -1 do
			InRound.Value = true
			wait(1)
			Status.Value = "Game: ".. i .." seconds left!"
		end
	end
end

spawn(roundTimer)

I hope this works! Let me know.

Best Regards,
BloxyFists

Hey! It started counting down from roundLength, then after 5 seconds, I would be teleported and sword given.