Teleporting a player above a part

local function onCharacterAdded(character)
	print("Character added")
	local player = Players:GetPlayerFromCharacter(character)
	local team = player.Team.Name
	--local cframe = game.Workspace:WaitForChild("The Parkour"):WaitForChild("Parkour_DONTCHANGENAME"):WaitForChild(team)
	character:WaitForChild("HumanoidRootPart").CFrame = game.Workspace:FindFirstChild("The Parkour"):FindFirstChild("Parkour_DONTCHANGENAME"):FindFirstChild(team).EffectPart.CFrame + Vector3.new(0, 5, 0)
	
end

local function onPlayerAdded(player)
	print("player added")
	player.CharacterAdded:Connect(onCharacterAdded)
end

Players.PlayerAdded:Connect(onPlayerAdded)

I add a character, both “player added” and “character added” printed, but I am not bieng teleported. Is this because I tested in studio or?

I’d be very surprised if it was because you tested in studio.
Can you check if this code works in a script in StarterCharacterScripts?

script.Parent:WaitForChild("HumanoidRootPart").CFrame = game.Workspace:FindFirstChild("The Parkour"):FindFirstChild("Parkour_DONTCHANGENAME"):FindFirstChild(team).EffectPart.CFrame + Vector3.new(0, 5, 0)

Side note, is there any errors?

Hello,

Is this a server script or local script? and where is this parented?

Server script in serverscriptstorage. It is running with no errors

try

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		Character:PivotTo(workspace["The Parkour"].Parkour_DONTCHANGENAME[Player.Team.Name].CFrame + Vector3.new(0,5,0))
	end)
end)