Help with a tp system for an obby

Hello developers,
I’m trying to make a teleporting system whenever a player touches a lava block, instead of dying, I wasn’t them to teleport to the checkpoint they were at. Read below for more information. Please answer them if you can.

  1. What do you want to achieve? Whenever a player touches a lava block, instead of the player dying, I want them to teleport them to the checkpoint they were at.

  2. What is the issue? I do not know what the script to that is. I’ve searched it up on YouTube and I’ve found no tutorials.

  3. What solutions have you tried so far? I’ve searched it up on Google and YouTube and I’ve found nothing so far.

Please help me on this situation. Anything would help. Thanks!

1 Like

What you could do is each time the player reaches a new checkpoint you save it on the server and then teleport the player back to the position of the checkpoint.


When the humanoid dies, check, and then set their HumanoidRootPart or Torso position to the desired checkpoint.

-- stuff

Thank you for the feedback, I’ll see if this works.

1 Like
local part = script.Parent

    if hit.Parent:FindFirstChild("Humanoid") then
       if hit.Parent:FindFirstChild("HumanoidRootPart") then
           hit.Parent.HumnaoidRootPart.CFrame = "Checkpoint CFrame"

This code may have typos I didn’t check it for spelling errors in the strings.


Thank you for the feedback, I’ll see if this works. :smiley:

Thank you for your feedback, I’ll see if this works.

You don’t need to wait for the humanoid to die to move it. At that point you might as well use Spawn Locations.

Also, the reason you didn’t find any tutorials, is because your request was specific.

You can just learn some lua and copypasting code won’t help at all (since you wont understand it)


This means he will have to create a script for every lava part…


I’m not aiming to provide good code. Obviously it would be better to use a Folder and loop through the folder. When you’re new to scripting it’s best to not add extra complexity to something you still haven’t yet learned.

1 Like

He can use CollectionService instead of creating hundreds of scripts.
Edit: Or the method Zylter suggested.

1 Like

Thank you everyone for your help. I’ll see if any of them help! :smiley:

1 Like

Well, if you have a leaderstats of the player’s stage, a quick way to do this is to make a folder of all your lava bricks. From there, name the folder “KillParts” or something, and this code applies to it. Also make sure to make a model/folder of all the checkpoints and name it “Checkpoints”:

local killparts = workspace:FindFirstChild("KillParts")
local checkpoints = workspace:FindFirstChild("Checkpoints")

for _, v in pairs(killparts:GetDescendants()) do
    if v:IsA("BasePart") then
            local char = hit:FindFirstAncestorOfClass("Model")
            local player = game.Players:GetPlayerFromCharacter(hit)
            local stage = player.leaderstats.Stage --correct this if you have another name for the stage

            char.HumanoidRootPart.CFrame = checkpoints:FindFirstChild(stage.Value).CFrame +,5,0)

From there, any part inside of the “KillParts” folder will teleport the player to their checkpoint when touched


Thank you for your feedback, I’ll see if this works. :smiley:

1 Like

try something like

local lava = game.Workspace.--name of your lava block
if lava.Touched then
Humanoid.Location == --wherever the checkpoint is

Hope that helped! That script may have some errors, i have no idea. Sorry if it does.


Thanks for your feedback, I’ll see if this will work!

1 Like

No problem. I have no idea if it does.

1 Like

Hey bro, I was just having the same problem as you, I was looking through these comments and couldn’t find anything which worked, if you haven’t already solved it yourself I found my own solution, let me know if you want me to share it with you.

you can do this by detecting if the player is touching the lava and if they are then they can tp to checkpoint
local player = game.Players.LocalPlayer
local lava = script.Parent
local checkpoint = script.Checkpoint

local hum = char:WaitForChild(“Humanoid”)


    if lava:IsDescendantOf(char) then
        char.HumanoidRootPart.CFrame = checkpoint.CFrame