Hello there, So I'm trying to teleport a player to a certain part using HumanoidRootPart after the timer is over. But it doesn't seem to work.
Here is the script:
local roundLength = 5
local intermissionLength = 5
local InRound = game.ReplicatedStorage:WaitForChild("inRound")
local Status = game.ReplicatedStorage:WaitForChild("Status")
local LobbySpawn = game.Workspace.LobbySpawn
local GameAreaSpawn = game.Workspace.GameAreaSpawn
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
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
end
end
end)
local function roundTimer()
while wait() do
wait(4.5)
for i = intermissionLength, 1, -1 do
InRound.Value = false
wait(1)
Status.Value = "Next minigame in: ".. i ..""
end
wait(4.5)
for i = roundLength, 1, -1 do
InRound.Value = true
wait(1)
Status.Value = "Time left: ".. i .." seconds!"
end
end
end
spawn (roundTimer)
I did a research and tried to Google it but nothing seems to work. Thank you!

6 comments
It works
Use Model:MoveTo() or Model:SetPrimaryPartCFrame(). I suggest you choose the latter (or second) since it tracks both your position and orientation.
@NoelGamer06 , doesn't seem to work for me though.
@Dovydas1118 , so I tried to do it but it doesn't work could you maybe send me how you did it?
I'm almost certain it's because your script is unable to actually execute the signal. You should be using a coroutine instead of the spawn() function.
@DeceptiveCaster , I created the coroutine and now it works, thanks!