Log in to vote

How would I make a spawn system, as seen in obbies? (Checkpoints)

Asked by 7 years ago

I'm having trouble making a obby spawn which means anytime you go to the next level, I want the player to hit the spawn then move on so when they die they dont go back to level 1, Example: Say i was on level 104, then I finally died then go back to level 1. If you don't understand, Here's more information Say, When I die on level 9, I don't(or players) don't wanna go back to level 1 with there hard work.

Thanks for advice :D

4 answers

Log in to vote
Answered by
Unclear 1776 Moderation Voter
7 years ago

As long as you have SpawnLocations with different TeamColors, Neutral disabled, and AllowTeamChangeOnTouch enabled, you can have your checkpoints. This will give you SpawnLocations that allows players sharing the same TeamColor as the SpawnLocation to spawn there.

Also make sure that each player's Neutral property is set to false to enable proper team changing!

If you're interested in players saving their level forever, you should look into Data Persistence and Data Store.

How'd I use that? Roboy5857 20 — 7y
DataStore Service Lightning_Game27 217 — 10mo
Log in to vote
Answered by 7 years ago

It is a free model. Basically, when your player is created, the leaderstat is made and when you respawn, your CFrame of your Torso is moved to 2 units above the part that has the name the same as the leaderstat. There is a script in the parts (not SpawnLocations) that see if you completed that stage - 1 and if you did, your leaderstat is changed to that parts name. No script editing, but feel free to make your own.

Log in to vote
Answered by 1 year ago

A man walks into a bar

Log in to vote
Answered by 11 months ago

ROBLOX created a model for a checkpoint here's the script because you may get into some viruses in the toolbox

local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")

local checkpoint = script.Parent

function onTouched(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid") then
        local player = Players:GetPlayerFromCharacter(hit.Parent)
        local checkpointData = ServerStorage:FindFirstChild("CheckpointData")
        if not checkpointData then
            checkpointData ="Folder")
            checkpointData.Name = "CheckpointData"
            checkpointData.Parent = ServerStorage

        local userIdString = tostring(player.UserId)
        local checkpointValue = checkpointData:FindFirstChild(userIdString)
        if not checkpointValue then
            checkpointValue ="ObjectValue")
            checkpointValue.Name = userIdString
            checkpointValue.Parent = checkpointData

                local storedCheckpoint = ServerStorage.CheckpointData[userIdString].Value
                character:MoveTo(storedCheckpoint.Position +, 4), 4, math.random(-4, 4)))

        checkpointValue.Value = checkpoint


Answer this question