Spawn obby checkpoint problem

Hello,

I have a problem with the checkpoints in my hobby, everything is working normally except that for some reason when I died at any checkpoint reappeared at the spawn.

here is my script

local checkpoints = workspace:WaitForChild("Checkpoints")

game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr

local v = Instance.new("IntValue")
v.Name = "Stage"
v.Value = 0
v.Parent = leaderstats

plr.CharacterAdded:Connect(function(char)
	local hum = char:WaitForChild("Humanoid")
	wait()
	char:MoveTo(checkpoints[v.Value].Position)

	hum.Touched:Connect(function(hit)
		if hit.Parent == checkpoints then
			if tonumber(hit.Name) == v.Value +1 then
				v.Value = v.Value +1
			end
		end
	end)
end)
end)
1 Like

You need to check if the character dies, and if so, have it move them to the respective spawn

How? sorry i’m not very good especially i don’t speak english and i use google translation

You can try this trusted model: https://www.roblox.com/library/2786054355

Try changing this line

char:MoveTo(checkpoints[v.Value].Position)

To this

char.HumanoidRootPart.Position = checkpoints[v.Value].Position + Vector3.new(0, 4, 0)
1 Like

thanks you ! you have discord??

I think this script from @P4CKSTABBER’s obby kit should work.

I don’t have discord sorry. But I’m glad to help :slight_smile:

oh no it doesn’t work anymore sorry

Can you try adding a wait for 2 seconds before teleportation?

it works but it’s not very pretty who teleports to the spawn then to the checkpoint

Then add a wait() (without any argument)

sometimes it works sometimes it doesn’t work

Give me some time, I am gonna try to fix this issue

I noticed that it works the first time but then when you continue the route and you die again it teleports to Spain

If it doesn’t work every time can you send your current script or look at your output for any errors? Saying it doesn’t work doesn’t really help to pinpoint the problem.