Why is the seeker still being teleported?

Hey, I’m creating a hide and seek game and in my handler I want the seeker to teleport 5 seconds after and its not working and he is teleporting with the players here is the code:
local Lobby = workspace:WaitForChild(“Lobby”)
local Maps = game.ReplicatedStorage.Maps:GetChildren()
local Status = game.ReplicatedStorage.StatusOfGame

while true do
task.wait(2)

for i = 5, 0, -1 do
	Status.Value = "Intermission"..i
	task.wait(1)
end

local selectedIT = game.Players:GetPlayers()[math.random(1, #game.Players:GetPlayers())]
local selectedMap = Maps[math.random(1)]
local clonedMap = selectedMap:Clone()
local SpawnPoints = clonedMap:FindFirstChild("SpawnPoints"):GetChildren()
local selectedSpawnPoint = SpawnPoints[math.random(1, #SpawnPoints)]
Status.Value = "Selected Map: "..selectedMap.Name
task.wait(3)
Status.Value = "The seeker is: "..selectedIT.DisplayName
task.wait(3)

-- Teleport all players
local teleportSeeker = false
for _, player in pairs(game.Players:GetPlayers()) do
	local char = player.Character
	local selectedPoint = SpawnPoints[math.random(1, #SpawnPoints)]
	if char then
		local HumanoidRootPart = char:FindFirstChild("HumanoidRootPart")
		if HumanoidRootPart then
			HumanoidRootPart.CFrame = selectedPoint.CFrame
			if player == selectedIT then
				teleportSeeker = true
			end
		end
	end
end

Status.Value = "Game Time: 60"

for i = 10, 0, -1 do
	Status.Value = "Game Time: "..i
	task.wait(1)
end

-- Teleport the seeker separately
if teleportSeeker then
	local selectedLobbyPart = Lobby.TeleportParts[math.random(1, #Lobby.TeleportParts:GetChildren())]
	local HRP = selectedIT.Character and selectedIT.Character:FindFirstChild("HumanoidRootPart")

	if HRP then
		HRP.CFrame = selectedLobbyPart.CFrame
		task.wait(2)
	end
end

-- Add a condition to end the game or reset if needed
-- For example, you might want to reset the map and repeat the process
-- You can use break to exit the loop or add a condition to restart the game

end

Maybe try replacing this

HumanoidRootPart.CFrame = selectedPoint.CFrame
if player == selectedIT then
    teleportSeeker = true
end

With this?

if player ~= selectedIT then
    HumanoidRootPart.CFrame = selectedPoint.CFrame
else
    teleportSeeker = true
end
1 Like

Hey so I don’t get teleported as the seeker but, it doesn’t teleport me at all.

Perhaps you could print the HRP variable after setting it to see if it’s not “nil”