How do I make a interchangeable checkpoint system

Basically, im making a sort of open-world parkour game, so for checkpoints I need them to be in a nonlinear fashion, so that you can actually go back if you wanted to. The issue is that I really have no idea how to do this, im still relativly new to scripting and I can’t find any tutorials on how to make the type of checkpoints I want. All I really need is for someone to tell me a way this I could make the system and I can script the rest. Any and all help is greatly appreciated!

2 Likes

What do you mean by nonlinear fashion? You can always go back in any checkpoint system. Can you give a couple more specific details about what you want?

I want it so that whenever you touch a checkpoint, that checkpoint is now your spawnpoint, it doesn’t matter if you went backwards, if you die, you respawn at the last touched checkpoint

Based on your post it looks like you just don’t want to make any checks regarding what checkpoint it is when setting the spawn point.

In that case, I would make a folder in the workspace containing all the checkpoints. For the player, you can connect a touched event for the humanoid and check what checkpoint they touched.

Here is a code outline:

humanoid.touched:Connect(function(hit)
   if hit.Parent == game.Workspace.Checkpoints then
      player.Checkpoint.Value = hit -- player.Checkpoint is an ObjectValue
   end
end)
1 Like

That works, thanks, I was pretty stuck

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.