This guide shows you how to create a working checkpoint system in Roblox Studio—a common feature in obbies and adventure games. When a player touches a checkpoint part, their spawn point updates so that if they fall or die, they respawn at the last checkpoint they reached. You’ll need Roblox Studio installed and a place (game) open. No scripting experience is required, but you’ll use a simple LocalScript and a ServerScript.
What You’ll Need
- Roblox Studio (free) with a game open.
- Basic understanding of the Explorer and Properties panels.
- A part to act as the checkpoint (e.g., a brick or a pad).
- A spawn location (or you can create one).
Step-by-Step
- Create the checkpoint part. In the Explorer, right-click on Workspace and select Insert Object → Part. Name it “Checkpoint” (or something unique). Resize it to a reasonable size—like 4x1x4 studs—using the Scale tool. Place it where you want the checkpoint to be, usually on the ground or at a platform edge.
- Make the part solid and anchored. Select the part. In the Properties panel, set Anchored to true (so it doesn’t fall) and CanCollide to true (so players can stand on it). If you want players to pass through it, set CanCollide to false, but then make sure it’s still touchable—it will be, as long as it’s not entirely inside another part.
- Add a spawn location (if you don’t have one). In the Explorer, right-click on Workspace → Insert Object → SpawnLocation. Name it “Spawn”. Place it at the start of your game. This is the default respawn point. You can also use an existing spawn location if you have one.
- Create a Folder for scripts. Right-click on Workspace (or ServerScriptService) → Insert Object → Folder. Name it “CheckpointScripts”. This is optional but keeps things tidy.
- Add a ServerScript to handle checkpoint logic. Right-click on the folder (or directly on Workspace) → Insert Object → Script. Name it “CheckpointHandler”. Open it and paste the following code:
-- Server script: updates the player's spawn point local checkpoint = script.Parent:WaitForChild("Checkpoint") -- adjust path if needed checkpoint.Touched:Connect(function(hit) local character = hit.Parent if character and character:FindFirstChild("Humanoid") then local player = game:GetService("Players"):GetPlayerFromCharacter(character) if player then -- Set the player's spawn point to the checkpoint's position player.RespawnLocation = checkpoint end end end)Note: The script assumes the Checkpoint part is a sibling of the script. If you placed the script inside a folder, adjust the path (e.g., script.Parent:WaitForChild(“Checkpoint”) if the folder is in Workspace and the part is also in Workspace). For simplicity, put the script directly under Workspace and the part also under Workspace, then use
script.Parent:WaitForChild("Checkpoint")—but if the part is named differently, change it. - Add a LocalScript for visual feedback (optional but recommended). Right-click on the folder → Insert Object → LocalScript. Name it “CheckpointFeedback”. Open it and paste:
-- Local script: shows a message when touching a checkpoint local checkpoint = script.Parent:WaitForChild("Checkpoint") -- adjust path checkpoint.Touched:Connect(function(hit) local character = hit.Parent if character and character:FindFirstChild("Humanoid") then local player = game:GetService("Players").LocalPlayer if player and character == player.Character then -- Show a brief notification game:GetService("StarterGui"):SetCore("SendNotification", { Title = "Checkpoint", Text = "Progress saved!", Duration = 2 }) end end end)Important: LocalScripts must be placed in a location that runs on the client, like StarterPlayerScripts or StarterGui, but they can also be inside Workspace if they are descendants of a Player’s character or a tool. For simplicity, place this LocalScript in StarterPlayer → StarterPlayerScripts instead, and reference the checkpoint part via a global reference or a RemoteEvent. However, to keep this guide simple, we’ll skip the LocalScript and just use the server script. The server script alone will work—players will respawn at the checkpoint without any visual cue. If you want the notification, you’ll need a more complex setup using RemoteEvents, which is beyond this basic guide.
- Test your checkpoint. Click the Play button in the toolbar to test your game. Walk your character onto the checkpoint part. Then jump off a cliff or use the Reset button (in the game menu) to die. You should respawn at the checkpoint’s location, not the original spawn.
- Add multiple checkpoints. To create a series of checkpoints, duplicate the checkpoint part (Ctrl+D) and place them along your course. Each part needs its own script or you can modify the script to handle multiple parts. For multiple parts, you can put the script in a folder and use a loop to connect each part. But for simplicity, you can copy the same script for each part—just make sure each script references its own part (e.g., change the part name in the script). Alternatively, use a single script that finds all parts named “Checkpoint” under a folder and connects them.
Common Mistakes
- Part not anchored: If the checkpoint part isn’t anchored, it might fall when the game starts, and players can’t touch it properly.
- Wrong script location: If you put the script in ServerScriptService but the part is in Workspace, the script won’t find the part unless you use a full path like
game.Workspace.Checkpoint. - Using a LocalScript for server logic: LocalScripts run on the client, so they can’t set the player’s RespawnLocation reliably. Use a Script (server) for that.
- Not checking for the Humanoid: If you don’t check for the Humanoid, the script might fire when a tool or a vehicle touches the part, causing errors or unintended spawns.
- Overwriting the spawn location: If you set
player.RespawnLocation = checkpointbut the checkpoint is not a SpawnLocation object, it won’t work. Actually, in Roblox, RespawnLocation can be any BasePart, so it works. But if you set it to nil, it resets to default.
Tips
- Make the checkpoint visually distinct: Use a bright color (e.g., green) and add a decal or a glowing effect to signal to players that it’s a checkpoint.
- Add a sound effect: Use a Sound object inside the checkpoint part and play it when touched (requires a small script addition).
- Use a folder for all checkpoints: Group all checkpoint parts under a single folder to keep your Workspace organized.
- Consider using a leaderboard or a GUI to show the last checkpoint reached: This is more advanced but can improve player experience.
- Test with multiple players: Checkpoints should work for each player individually, but test with two players to ensure no conflicts.
Troubleshooting
- Players don’t respawn at the checkpoint: Make sure the script is running. Check the Output window (View → Output) for errors. Common issues: the part name is misspelled, or the script is not under the same parent as the part. Also, ensure the player’s character has a Humanoid—if you’re testing with a custom character, it might not.
- The script doesn’t detect the touch: The Touched event only fires when a part with a Humanoid touches the checkpoint. If the player is in a vehicle, it might not work. Also, if the checkpoint is not anchored, it might move away before touch.
- Multiple checkpoints overwrite each other: If you have several checkpoint parts and each has a script that sets RespawnLocation, the last one touched wins. That’s correct. But if you want to keep the most recent, make sure each script sets it to its own part.
- The notification doesn’t appear: If you added the LocalScript but didn’t place it correctly, it won’t run. Put it in StarterPlayerScripts and reference the checkpoint via a global variable or a RemoteEvent. For simplicity, skip the notification.
- Players respawn at the original spawn even after touching: Check if the checkpoint part is actually a SpawnLocation? No, it doesn’t have to be. But if you set RespawnLocation to a part that is not in the Workspace (e.g., a part that gets destroyed), it might fail. Keep the checkpoint part in Workspace.
Frequently Asked Questions
- Can I use a SpawnLocation as a checkpoint? Yes, you can place a SpawnLocation and set its Neutral property or use scripts to make it active only when touched. But using a regular part is simpler.
- Do checkpoints work for all players in a multiplayer game? Yes, the script sets the RespawnLocation per player, so each player has their own checkpoint.
- How do I make a checkpoint that only activates once? Add a boolean variable in the script to track if it’s been activated, and only set the spawn point the first time.
- Can I make the checkpoint give a message or a reward? Yes, you can add more code to the Touched event to give points, play sounds, or show a GUI.
- What if I want the checkpoint to be a region instead of a part? Use a Part with a large size or use a Region3 and check if the player’s position is inside. But a part is easiest.
- Why does my script error with “RespawnLocation is not a valid member”? That error occurs if you’re trying to set it on a non-player object. Make sure you get the Player object correctly using GetPlayerFromCharacter.