I asked this question before but it was not answered so I am just going to ask again. I am making an obby and I need checkpoints. I am creating my checkpoints using the character's Torso and the leaderboard stats. If the player's leaderboard "Stage" stat is 1, then when they die, they will be teleported to Checkpoint 1. To do this, I added a script inside each checkpoint and used functions. The problem is, the player isn't being spawned on the checkpoint. The output shows no errors so I don't know what to do. My script is being shown below and help is much appreciated. Thank you in advanced.
local checkpoint = script.Parent
checkpoint.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.leaderstats.Stage.Value = 1
end
end)
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if plr.leaderstats.Stage.Value == 1 then
char.Torso.CFrame = game.Workspace.Checkpoint1.CFrame + Vector3.new(0, 10, 0)
end
end)
end)
