Checkpoint System Script
Customize your variables, then fill in the blanks!
Your Custom Settings
Starting checkpoint (usually "1")
LocalScript (StarterPlayerScripts)
This script saves progress at checkpoints and respawns players at their last checkpoint. Create a "Checkpoints" folder in Workspace with numbered parts (1, 2, 3, etc.).
local player = game..
local checkpoints = workspace:("Checkpoints")
local lastCheckpointPart
lastCheckpointPart = checkpoints:WaitForChild("1")
player.:Connect(function(character)
local hrp = character:WaitForChild("")
task.wait(0.1)
if lastCheckpointPart then
hrp. = lastCheckpointPart.CFrame + .new(0, 3, 0)
end
end)
for _, checkpoint in pairs(checkpoints:GetChildren()) do
if checkpoint:IsA("BasePart") then
checkpoint.:Connect(function(hit)
local character = hit:FindFirstAncestorOfClass("Model")
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid and player.Character == character then
if lastCheckpointPart ~= checkpoint then
lastCheckpointPart = checkpoint
end
end
end)
end
end
