Hello, Im trying to make a checkpoint for a obby.
No errors in the output and it does not work.
Here is my script:
local checkpoints = workspace:WaitForChild("CheckPoints")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Parent = leaderstats
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
wait()
char:MoveTo(checkpoints[stage.Value].Position)
hum.Touched:Connect(function(hit)
if hit.Parent == checkpoints then
if tonumber(hit.Name) == stage.Value + 1 then
stage.Value = stage.Value + 1
end
end
end)
end)
end)
Alright, i have a obby, and theres a spawn, and checkpoint, i think your script makes it that the spawnpoint does not exist and instantly overrights the checkpoint as a spawn causing the player to spawn there. cus when i load in i dont spawn at the spawn. and when i touch a other checkpoint and die i dont respawn back there