im making a hide and seek roblox game using luau
how can i add this into my game:
Hider/Seeker Selection
Pick 1 player to be Seeker
Others become Hiders.
Announce roles to each player:
“You are a Seeker!” or “You are a Hider!”
This is my main game loop script
-- Declared Variables
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")

local IntermissionTime = 5
local RoundTime = 10
local HidingTime = 5
local MinPlayers = 1


local VotingEvent = game.ReplicatedStorage:WaitForChild("Voting")
local UpdateVotes = game.ReplicatedStorage:WaitForChild("UpdateVotes")
local voteTime = 5

-- Declared Functions
local function TeleportPlayers(cframe) -- Teleport all players to a given CFrame
	local players = Players:GetPlayers()
	for i, player in players do
		if not player.Character then continue end
		
		player.Character:PivotTo(cframe)
	end
end

local function Countdown(duration) -- Countdown for a given duration variable
	for i = duration, 1, -1 do
		workspace:SetAttribute("Clock", i)
		task.wait(1)
	end
end

local function Intermission()
	print("Intermission")
	workspace:SetAttribute("Status", "Intermission")
	TeleportPlayers(workspace.IntermissionArea.SpawnLocation.CFrame * CFrame.new(0, 2, 0))
	Countdown(IntermissionTime)
end

local function RunGame(map) -- Run the game with a given map
	print("Game Begins")
	TeleportPlayers(map.Spawn.CFrame)
	workspace:SetAttribute("Status", "Time To Hide")
	Countdown(HidingTime)  
	workspace:SetAttribute("Status", "Time remaining")
	Countdown(RoundTime)
	task.wait(1)
	map:Destroy()
end

-- Game Loop
while true do
	if #Players:GetPlayers() >= MinPlayers then
		Intermission()
		workspace:SetAttribute("Status", "Loading Map...")
		print("New Game!")

		-- Map voting
		-- Declared Variables
		local mapVotes = {}
		local plrVotes = {}
		local selectedMaps = {}
		local currentMaps = game.ServerStorage.Maps:GetChildren()
		for i = 1, 3 do

			local newMap = currentMaps[math.random(#currentMaps)]
			table.remove(currentMaps, table.find(currentMaps, newMap))
			table.insert(selectedMaps, {
				Name = newMap.Name,
				Img = newMap:GetAttribute("MapImg")
			})

			mapVotes[newMap.Name] = 0
		end

		VotingEvent:FireAllClients(selectedMaps, voteTime)

		UpdateVotes.OnServerInvoke = function(player, vote)
			if vote then
				local mapModel = game.ServerStorage.Maps:FindFirstChild(vote)
				if not mapModel or not mapVotes[mapModel.Name] then
					warn(tostring(vote).. " is not a votable map")
					return mapVotes
				end

				local playerVote = plrVotes[player.UserId]
				if playerVote then
					mapVotes[playerVote] -= 1
				end
				plrVotes[player.UserId] = vote

				mapVotes[vote] += 1
			end

			return mapVotes
		end

		task.wait(voteTime)

		VotingEvent:FireAllClients(nil)
		UpdateVotes.OnServerInvoke = nil

		local chosenMap = nil
		local highestVotes = 0

		for name, votes in pairs(mapVotes) do
			if votes >= highestVotes then
				chosenMap = game.ServerStorage.Maps[name]
				highestVotes = votes
			end
		end

		print(chosenMap, "was picked")
		task.wait(1)

		local newMap = chosenMap:Clone()
		newMap.Parent = workspace -- Map is spawned into workspace

	--	local maps = ServerStorage.Maps:GetChildren()
	--	local randomMap = maps[math.random(#maps)] -- Random map is chosen
	
	--	local newMap = randomMap:Clone()
	--	newMap.Parent = workspace -- Chosen Map is moved into workspace
	--	task.wait(1)
		RunGame(newMap) -- Players are teleported into the map
	else
		print("Waiting for players...")
		workspace:SetAttribute("Status", "Waiting for players...")
		task.wait(1)
	end
	
end
this is my local script for game status gui
local gui = script.Parent

local function FormatTime(seconds) -- Format seconds as MM:SS
	local minutes = math.floor(seconds / 60)
	local remainingSeconds = seconds % 60
	return string.format("%02d:%02d", minutes, remainingSeconds)
end

local function UpdateStatus() -- Update the GUI with the current status and time
	local clockTime = workspace:GetAttribute("Clock")
	local gameStatus = workspace:GetAttribute("Status")

	if (gameStatus == "Time remaining" or gameStatus == "Intermission" or gameStatus == "Time To Hide") and clockTime then
		gui.Display.StatusText.Text = gameStatus .. " : " .. FormatTime(clockTime)
	else
		gui.Display.StatusText.Text = gameStatus
	end
end

workspace:GetAttributeChangedSignal("Clock"):Connect(UpdateStatus)
workspace:GetAttributeChangedSignal("Status"):Connect(UpdateStatus)

UpdateStatus()