This line will not run no matter what

player.CharacterAdded:Connect(function(char)
	char:WaitForChild("HumanoidRootPart")
	char:SetPrimaryPartCFrame(game.Workspace.Checkpoints["Checkpoint"..tostring(game.Players:GetPlayerFromCharacter(char).leaderstats.Stage.Value)]:GetPrimaryPartCFrame()+Vector3.new(0,5,0))
end)

I tried print statements, and 1. The checkpoint CFrame works 2. HumanoidRootPart Cframe works
The line somehow runs when I put it in a for loop running 100 times, I’m just guessing that something wasn’t loaded at the time this line ran.

try this

local char = player.Character or player.CharacterAdded:Wait()
function stuff(char)
char:WaitForChild("HumanoidRootPart")
char:SetPrimaryPartCFrame(game.Workspace.Checkpoints["Checkpoint"..tostring(game.Players:GetPlayerFromCharacter(char).leaderstats.Stage.Value)]:GetPrimaryPartCFrame()+Vector3.new(0,5,0))
end
stuff(char)
player.CharacterAdded:Connect(stuff)

That worked in teleporting the player once, at the stuff(char) line but the main line (in CharacterAdded) still doesn’t work :c

local char = player.Character or player.CharacterAdded:Wait()
function stuff(char)
char:WaitForChild("HumanoidRootPart")
char:SetPrimaryPartCFrame(game.Workspace.Checkpoints["Checkpoint"..tostring(game.Players:GetPlayerFromCharacter(char).leaderstats.Stage.Value)]:GetPrimaryPartCFrame()+Vector3.new(0,5,0))
end
player.CharacterAdded:Connect(stuff)(char)

Try this to fix the CharacterAdded line.

Its not that, its the

char:SetPrimaryPartCFrame(game.Workspace.Checkpoints["Checkpoint"..tostring(game.Players:GetPlayerFromCharacter(char).leaderstats.Stage.Value)]:GetPrimaryPartCFrame()+Vector3.new(0,5,0))

that won’t run. Everything else connects perfectly.

the game teleported the player back to the default spawn position
i made a similar obby checkpoint thing before and it does that as well

try maybe set player.RespawnLocation

Ok, I just created a loop and it worked now.
(an while true with if loop)

just try doing player.RespawnLocation and player:LoadCharacter() to avoid using loops

is that a CFrame or Vector3?
I want it to be a CFrame so the player is facing the correct way the obby goes.

read this post it may help

The for loop works pretty well for me, it only runs twice, and since the checkpoints are absolutely from scratch, they aren’t spawnlocations. Thanks though :slight_smile: