#Checkpoint system for infinite obby game

1 messages · Page 1 of 1 (latest)

latent barn
#

Hey there! I wanted to create a ckeckpoint system for the infinite obby game but i am not expert at scripting, actually i have no idea what to do lol. He said this: "add a touch part and when the client touches that part save the cframe then when a new character has spawned move them to that cframe" _which sounds reasonable but i have no clue on how to make that a local script...

rustic ferry
latent barn
#

nope.

rustic ferry
#
local checkPoints = workspace:WaitForChild("CheckPoint")

game.Players.PlayerAdded:Connect(function(Player) -- the given paramter of the player
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "Leaderstats"
    leaderstats.Parent = Player
    
    local stage = Instance.new("IntValue")
    stage.Name = "Stage"
    stage.Value = 1
    stage.Parent = leaderstats
    
    Player.CharacterAdded:Connect(function(char)
        local Humanoid = char:WaitForChild("Humanoid")
        wait()
        char:MoveTo(checkPoints[stage.Value].Position)
        
        Humanoid.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)`
#

@latent barn

#

create a folder of your checkpoints

latent barn
#

omg thank you so much!

rustic ferry
#

np

#

also put this in serverscriptservice