Skip to content
The Chat Archive
amazon-nova-experimental-chat-05-14 LMArena Human Preference 140K

im making a hide and seek roblox game using luau how can i add this into my game:…

  1. User

    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()

  2. Assistant

    Certainly! Below are the steps and code modifications to add Hider/Seeker role selection to your Roblox hide and seek game using Luau.

    Step-by-Step Guide

    1. Select the Seeker:

      • Randomly pick one player to be the Seeker.
      • The remaining players will be Hiders.
    2. Announce Roles:

      • Send a message to each player informing them of their role.
    3. Modify the Main Game Loop Script:

      • Add functions to handle role selection and announcement.
      • Integrate these functions into the game loop.
    4. Modify the Local Script for GUI:

      • Update the GUI to display the player's role.

    Modified Main Game Loop Script

    Here's how you can modify your main game loop script to include Hider/Seeker selection and role announcements.

    -- Declared Variables
    local Players = game:GetService("Players")
    local ServerStorage = game:GetService("ServerStorage")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    
    local IntermissionTime = 5
    local RoundTime = 10
    local HidingTime = 5
    local MinPlayers = 1
    
    local VotingEvent = ReplicatedStorage:WaitForChild("Voting")
    local UpdateVotes = ReplicatedStorage:WaitForChild("UpdateVotes")
    local AnnounceRoleEvent = Instance.new("RemoteEvent")
    AnnounceRoleEvent.Name = "AnnounceRole"
    AnnounceRoleEvent.Parent = ReplicatedStorage
    local voteTime = 5
    
    
    -- Declared Functions
    local function TeleportPlayers(cframe) -- Teleport all players to a given CFrame
    	local players = Players:GetPlayers()
    	for i, player in ipairs(players) do
    		if player.Character then
    			player.Character:PivotTo(cframe)
    		end
    	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
    
    local function SelectRoles()
    	local players = Players:GetPlayers()
    	if #players < 2 then return end -- Not enough players to select roles
    	
    	-- Randomly select the seeker
    	local seeker = players[math.random(1, #players)]
    	
    	-- Announce roles to each player
    	for _, player in ipairs(players) do
    		if player == seeker then
    			AnnounceRoleEvent:FireClient(player,"You are a Seeker!")
    		else
    			AnnounceRoleEvent:FireClient(player,"You are a Hider!")
    		end
    	end
    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 = 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 = 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] = mapVotes[playerVote] - 1
    				end
    				plrVotes[player.UserId] = vote
    
    				mapVotes[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 = 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
    
    		SelectRoles() -- Select and announce roles
    
    		RunGame(newMap) -- Players are teleported into the map
    	else
    		print("Waiting for players...")
    		workspace:SetAttribute("Status", "Waiting for players...")
    		task.wait(1)
    	end
    end
    

    Modified Local Script for Game Status GUI

    Update your local script to listen for the role announcement and display it to the player.

    local gui = script.Parent
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local AnnounceRoleEvent = ReplicatedStorage:WaitForChild("AnnounceRole")
    
    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
    
    local function AnnounceRole(roleMessage)
    	gui.Display.RoleText.Text = roleMessage -- Assuming you have a RoleText label in your GUI
    end
    
    -- Connect signals
    workspace:GetAttributeChangedSignal("Clock"):Connect(UpdateStatus)
    workspace:GetAttributeChangedSignal("Status"):Connect(UpdateStatus)
    AnnounceRoleEvent.OnClientEvent:Connect(AnnounceRole)
    
    -- Initial update
    UpdateStatus()
    gui.Display.RoleText.Text = "" -- Clear any previous role text
    

    Explanation

    1. Role Selection:

      • The SelectRoles function randomly selects one player to be the Seeker and announces the roles to each player using the AnnounceRoleEvent.
    2. Announcing Roles:

      • The AnnounceRoleEvent is a RemoteEvent that sends a message to the client, informing the player of their role.
      • On the client side the AnnounceRole function updates the GUI to display the player's role
    3. Game Loop Integration:

      • The SelectRoles function is called after the map is voted on and before the game starts, ensuring roles are assigned at the beginning of each round.
    4. GUI Update:

      • The local script listens for the AnnounceRoleEvent and updates a RoleText label in the GUI to display the player's role.
  3. User

    Visual Feedback: Add particle effects or sounds when roles are assigned (seeker has different particles effects and sounds compared to hiders) Team Colors: Use player.Team to visually distinguish Seekers/Hiders and sort them into teams so you can see them on the leaderboard change text colour red if player is seeker and text colour blue if player is hider

  4. Assistant

    Sure! Below are the modifications to add visual feedback, team colors, and change text color based on the player's role.

    Server Script Modifications

    1. Add Particle Effects and Sounds:

      • Use RemoteEvents to trigger particle effects and sounds on the client.
      • Create particle effects and sounds in ServerStorage.
    2. Team Colours:

      • Use the Teams service to create and assign teams.
      • Use Player.TeamColor to set the team colour

    Modified Main Game Loop Script

    -- Declared Variables
    local Players = game:GetService("Players")
    local ServerStorage = game:GetService("ServerStorage")
    local Teams = game:GetService("Teams")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    
    local IntermissionTime = 5
    local RoundTime = 10
    local HidingTime = 5
    local MinPlayers = 1
    
    local VotingEvent = ReplicatedStorage:WaitForChild("Voting")
    local UpdateVotes = ReplicatedStorage:WaitForChild("UpdateVotes")
    local AnnounceRoleEvent = Instance.new("RemoteEvent")
    AnnounceRoleEvent.Name = "AnnounceRole"
    AnnounceRoleEvent.Parent = ReplicatedStorage
    local voteTime = 5
    
    -- Create Teams
    local SeekersTeam = Instance.new("Team")
    SeekersTeam.Name = "Seekers"
    SeekersTeam.TeamColor = BrickColor.Red()
    SeekersTeam.Parent = Teams
    
    local HidersTeam = Instance.new("Team")
    HidersTeam.Name = "Hiders"
    HidersTeam.TeamColor = BrickColor.Blue()
    HidersTeam.Parent = Teams
    
    
    -- Declared Functions
    local function TeleportPlayers(cframe) -- Teleport all players to a given CFrame
    	local players = Players:GetPlayers()
    	for i, player in ipairs(players) do
    		if player.Character then
    			player.Character:PivotTo(cframe)
    		end
    	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
    
    local function SelectRoles()
    	local players = Players:GetPlayers()
    	if #players < 2 then return end -- Not enough players to select roles
    	
    	-- Randomly select the seeker
    	local seeker = players[math.random(1, #players)]
    	
    	-- Announce roles to each player
    	for _, player in ipairs(players) do
    		if player == seeker then
    			player.Team = SeekersTeam
    			AnnounceRoleEvent:FireClient(player,"You are a Seeker!", "seeker")
    		else
    			player.Team = HidersTeam
    			AnnounceRoleEvent:FireClient(player,"You are a Hider!", "hider")
    		end
    	end
    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 = 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 = 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] = mapVotes[playerVote] - 1
    				end
    				plrVotes[player.UserId] = vote
    
    				mapVotes[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 = 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
    
    		SelectRoles() -- Select and announce roles
    
    		RunGame(newMap) -- Players are teleported into the map
    	else
    		print("Waiting for players...")
    		workspace:SetAttribute("Status", "Waiting for players...")
    		task.wait(1)
    	end
    	
    	-- Clear teams for next round
    	for _, player in ipairs(Players:GetPlayers()) do
    		player.Team = nil
    	end
    end
    

    Modified Local Script for Game Status GUI

    local gui = script.Parent
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local AnnounceRoleEvent = ReplicatedStorage:WaitForChild("AnnounceRole")
    local Player = game:GetService("Players").LocalPlayer
    
    local seekerParticles = ReplicatedStorage:WaitForChild("SeekerParticles")
    local hiderParticles = ReplicatedStorage:WaitForChild("HiderParticles")
    local seekerSound = ReplicatedStorage:WaitForChild("SeekerSound")
    local hiderSound = ReplicatedStorage:WaitForChild("HiderSound")
    
    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
    
    local function AnnounceRole(roleMessage, roleType)
    	gui.Display.RoleText.Text = roleMessage -- Assuming you have a RoleText label in your GUI
    	
    	-- Change text colour based on role
    	if roleType == "seeker" then
    		gui.Display.RoleText.TextColor3 = Color3.fromRGB(255, 0, 0) -- Red for Seeker
    	elseif roleType == "hider" then
    		gui.Display.RoleText.TextColor3 = Color3.fromRGB(0, 0, 255) -- Blue for Hider
    	end
    
    	-- Play particle effects and sounds
    	if Player.Character then
    		local character = Player.Character
    		if roleType == "seeker" then
    			local particles = seekerParticles:Clone()
    			particles.Parent = character
    			particles:Emit(10) -- Adjust the number of particles as needed
    			seekerSound:Clone().Parent = character
    			seekerSound:Play()
    		elseif roleType == "hider" then
    			local particles = hiderParticles:Clone()
    			particles.Parent = character
    			particles:Emit(10) -- Adjust the number of particles as needed
    			hiderSound:Clone().Parent = character
    			hiderSound:Play()
    		end
    	end
    end
    
    -- Connect signals
    workspace:GetAttributeChangedSignal("Clock"):Connect(UpdateStatus)
    workspace:GetAttributeChangedSignal("Status"):Connect(UpdateStatus)
    AnnounceRoleEvent.OnClientEvent:Connect(AnnounceRole)
    
    -- Initial update
    UpdateStatus()
    gui.Display.RoleText.Text = "" -- Clear any previous role text
    

    Explanation

    1. Teams:

      • Two teams, SeekersTeam and HidersTeam, are created and assigned colors (red for seekers, blue for hiders).
      • Players are assigned to these teams based on their roles.
    2. Particle Effects and Sounds:

      • seekerParticles, hiderParticles, seekerSound, and hiderSound are stored in ReplicatedStorage.
      • When a role is announced, the corresponding particle effect and sound are cloned and played on the player's character.
    3. Text Colour:

      • The AnnounceRole function changes the text colour of the RoleText label based on the player's role.
      • Red for seekers and blue for hiders.
    4. Clearing Teams:

      • Teams are cleared at the end of each round to prepare for the next round.
  5. User

    i want it so that there is not particles or highlight for hiders and hiders can see seeker highlighted and with particles, the seeker can be seen through structures to hiders, but on the seekers screen the seeker is not higlighted and clear the teams when the round is over.

  6. Assistant

    Certainly! Below are the modifications to achieve the desired behavior:

    1. Highlight and Particles for Seeker:

      • Only the Seeker will have particles and a highlight.
      • Hiders can see the Seeker highlighted and with particles.
      • The Seeker cannot see their own highlight and particles.
      • The Seeker can be seen through structures by Hiders.
    2. Clear Teams:

      • Teams are cleared at the end of each round.

    Modified Main Game Loop Script

    -- Declared Variables
    local Players = game:GetService("Players")
    local ServerStorage = game:GetService("ServerStorage")
    local Teams = game:GetService("Teams")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    
    local IntermissionTime = 5
    local RoundTime = 10
    local HidingTime = 5
    local MinPlayers = 1
    
    local VotingEvent = ReplicatedStorage:WaitForChild("Voting")
    local UpdateVotes = ReplicatedStorage:WaitForChild("UpdateVotes")
    local AnnounceRoleEvent = Instance.new("RemoteEvent")
    AnnounceRoleEvent.Name = "AnnounceRole"
    AnnounceRoleEvent.Parent = ReplicatedStorage
    local voteTime = 5
    
    -- Create Teams
    local SeekersTeam = Instance.new("Team")
    SeekersTeam.Name = "Seekers"
    SeekersTeam.TeamColor = BrickColor.Red()
    SeekersTeam.Parent = Teams
    
    local HidersTeam = Instance.new("Team")
    HidersTeam.Name = "Hiders"
    HidersTeam.TeamColor = BrickColor.Blue()
    HidersTeam.Parent = Teams
    
    
    -- Declared Functions
    local function TeleportPlayers(cframe) -- Teleport all players to a given CFrame
    	local players = Players:GetPlayers()
    	for i, player in ipairs(players) do
    		if player.Character then
    			player.Character:PivotTo(cframe)
    		end
    	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
    
    local function SelectRoles()
    	local players = Players:GetPlayers()
    	if #players < 2 then return end -- Not enough players to select roles
    	
    	-- Randomly select the seeker
    	local seeker = players[math.random(1, #players)]
    	
    	-- Announce roles to each player
    	for _, player in ipairs(players) do
    		if player == seeker then
    			player.Team = SeekersTeam
    			AnnounceRoleEvent:FireClient(player,"You are a Seeker!", "seeker")
    		else
    			player.Team = HidersTeam
    			AnnounceRoleEvent:FireClient(player,"You are a Hider!", "hider")
    		end
    	end
    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 = 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 = 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] = mapVotes[playerVote] - 1
    				end
    				plrVotes[player.UserId] = vote
    
    				mapVotes[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 = 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
    
    		SelectRoles() -- Select and announce roles
    
    		RunGame(newMap) -- Players are teleported into the map
    	else
    		print("Waiting for players...")
    		workspace:SetAttribute("Status", "Waiting for players...")
    		task.wait(1)
    	end
    	
    	-- Clear teams for next round
    	for _, player in ipairs(Players:GetPlayers()) do
    		player.Team = nil
    	end
    end
    

    Modified Local Script for Game Status GUI

    local gui = script.Parent
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local AnnounceRoleEvent = ReplicatedStorage:WaitForChild("AnnounceRole")
    local Player = game:GetService("Players").LocalPlayer
    local UserInterfaceService = game:GetService("UserInterfaceService")
    
    local seekerParticles = ReplicatedStorage:WaitForChild("SeekerParticles")
    local seekerHighlight = ReplicatedStorage:WaitForChild("SeekerHighlight")
    local seekerSound = ReplicatedStorage:WaitForChild("SeekerSound")
    
    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
    
    local function AnnounceRole(roleMessage, roleType)
    	gui.Display.RoleText.Text = roleMessage -- Assuming you have a RoleText label in your GUI
    	
    	-- Change text colour based on role
    	if roleType == "seeker" then
    		gui.Display.RoleText.TextColor3 = Color3.fromRGB(255, 0, 0) -- Red for Seeker
    	elseif roleType == "hider" then
    		gui.Display.RoleText.TextColor3 = Color3.fromRGB(0, 0, 255) -- Blue for Hider
    	end
    
    	-- Play particle effects and sounds for Seeker
    	if roleType == "seeker" then
    		if Player.Character then
    			local character = Player.Character
    			
    			-- Add particles
    			local particles = seekerParticles:Clone()
    			particles.Parent = character
    			particles:Emit(10) -- Adjust the number of particles as needed
    			
    			-- Add highlight
    			local highlight = seekerHighlight:Clone()
    			highlight.Parent = character
    			highlight.Adornee = character
    			
    			-- Play sound
    			seekerSound:Clone().Parent = character
    			seekerSound:Play()
    		end
    	elseif roleType == "hider" then
    		-- Hiders can see the seeker highlighted and with particles
    		for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
    			if player.Team == game:GetService("Teams"):FindFirstChild("Seekers") and player.Character then
    				local character = player.Character
    				
    				-- Add particles
    				local particles = seekerParticles:Clone()
    				particles.Parent = character
    				particles:Emit(10) -- Adjust the number of particles as needed
    				
    				-- Add highlight
    				local highlight = seekerHighlight:Clone()
    				highlight.Parent = character
    				highlight.Adornee = character
    			end
    		end
    	end
    end
    
    -- Connect signals
    workspace:GetAttributeChangedSignal("Clock"):Connect(UpdateStatus)
    workspace:GetAttributeChangedSignal("Status"):Connect(UpdateStatus)
    AnnounceRoleEvent.OnClientEvent:Connect(AnnounceRole)
    
    -- Initial update
    UpdateStatus()
    gui.Display.RoleText.Text = "" -- Clear any previous role text
    

    Explanation

    1. Highlight and Particles for Seeker:

      • When a player is assigned the Seeker role, particles, a highlight, and a sound are added to their character.
      • Hiders can see the Seeker highlighted and with particles because the script adds these effects to the Seeker's character for all Hiders.
      • The Seeker does not see their own highlight and particles because the script only adds these effects for Hiders when the Seeker's role is announced.
    2. Seeing Through Structures:

      • The seekerHighlight should have the FillTransparency property set to 1 and the OutlineTransparency property set to 0 to make the Seeker visible through structures.
    3. Clearing Teams:

      • Teams are cleared at the end of each round to prepare for the next round.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.