Roblox Obby Checkpoint Script (With Auto DataStore Save)
Handles numbered parts inside Workspace.Checkpoints (1, 2, 3...) and automatically saves each player's Stage across sessions.
-- Script in ServerScriptService
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local store = DataStoreService:GetDataStore("ObbyStages_v1")
local checkpoints = workspace:WaitForChild("Checkpoints")
local function moveToStage(char: Model, stageNum: number)
local pad = checkpoints:FindFirstChild(tostring(stageNum)) :: BasePart?
if pad then
task.wait()
char:PivotTo(pad.CFrame + Vector3.new(0, 4, 0))
end
end
for _, pad in ipairs(checkpoints:GetChildren()) do
if pad:IsA("BasePart") then
local num = tonumber(pad.Name)
if num then
pad.Touched:Connect(function(hit)
local p = Players:GetPlayerFromCharacter(hit.Parent)
local stage = p and p:FindFirstChild("leaderstats") and p.leaderstats:FindFirstChild("Stage")
if stage and num == stage.Value + 1 then
stage.Value = num
end
end)
end
end
end
Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = player
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Value = 1
stage.Parent = stats
local ok, saved = pcall(function() return store:GetAsync("s_" .. player.UserId) end)
if ok and type(saved) == "number" then stage.Value = saved end
player.CharacterAdded:Connect(function(char) moveToStage(char, stage.Value) end)
end)
Players.PlayerRemoving:Connect(function(player)
local stage = player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Stage")
if stage then pcall(function() store:SetAsync("s_" .. player.UserId, stage.Value) end) end
end)How to install in Studio
- Create a Folder named Checkpoints inside Workspace and add Parts named 1, 2, 3, etc.
- Insert a Script named CheckpointSystem inside ServerScriptService and paste the code.
- Enable Studio Access to API Services in Game Settings > Security to test saving in Studio.
Tips & customization
- Change `num == stage.Value + 1` to `num > stage.Value` if players are allowed to skip ahead.
Common questions.
Why does DataStore say API Services not enabled in Studio?
Open Game Settings > Security in Roblox Studio and toggle 'Enable Studio Access to API Services' ON.
More free Luau scripts.
LocalScript
Shift-to-Sprint Script
Hold Left Shift to sprint smoothly with a subtle camera FieldOfView boost and clean speed reset on release.
Copy script →
LocalScript
Double Jump Script
Lets players jump a second time mid-air using Roblox's JumpRequest event (works on PC, mobile, and controller).
Copy script →
Script
Kill Brick Script
Instead of copying 100 scripts into 100 lava bricks, tag any part 'KillBrick' and let one clean server script handle all of them.
Copy script →
Script
Round System Script
A clean server loop that runs Intermission -> Active Round -> Winner announcement and updates a shared Status StringValue for your HUD.
Copy script →
Skip manual wiring.
Let Revix code & playtest it.
Start building freeFree to start. No card needed.
