Hello! I’m making a difficulty chart on my main, Bruhuhos. I’ve been working on a checkpoint system for hours but it hasn’t been working. I would love to get feedback on how to make this work and even models or scrips! I would love that, but also a script to save for when they leave and come back…
Please Help! Feedback and other stuff is good but I’ll link the difficulty chart soon…
So I’m making a obby right now, and I found this script from Packstabber from the toolbox. Since I couldn’t find the original pack, I’ll just share this script with you.
--[[By nicemike40 (credit appreciated)
Intructions:
This was found from Packsabber model.
Note: Capitalization and spelling is important!
--]]
-- settings:
local STAT_NAME = "Stage"
local PREVENT_SKIPPING = true
local checkpoints = {}
local i = 1
while true do
local checkpoint = Workspace:FindFirstChild("Checkpoint " .. i, true)
if not checkpoint then print("Last Checkpoint : " .. i-1) break end
table.insert(checkpoints, checkpoint)
i = i + 1
end
game.Players.PlayerAdded:connect(function(player)
local leaderstats = player:FindFirstChild("leaderstats") or Instance.new("Model", player)
leaderstats.Name = "leaderstats"
local checkpointStat = Instance.new("IntValue", leaderstats)
checkpointStat.Name = STAT_NAME
checkpointStat.Value = 1
player.CharacterAdded:connect(function(character)
local goto = checkpoints[checkpointStat.Value]
if goto then
repeat wait() until character.Parent
character:MoveTo(goto.Position)
else
warn("Checkpoint " .. checkpointStat.Value .. " not found")
end
end)
end)
for index, checkpoint in ipairs(checkpoints) do
checkpoint.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if not humanoid or humanoid.Health <= 0 then return end
local leaderstats = player:FindFirstChild("leaderstats")
if not leaderstats then return end
local checkpointStat = leaderstats:FindFirstChild(STAT_NAME)
if not leaderstats then return end
if (PREVENT_SKIPPING and checkpointStat.Value + 1 == index) or (not
PREVENT_SKIPPING and checkpointStat.Value < index) then
checkpointStat.Value = index
end
end)
end
Just name each checkpoint “Checkpoint 1”, “Checkpoint 2”, etc. When you step on it, the stage will update on the leaderboard!
So just put the script anywhere under Workspace, and name the spawn Checkpoint 1, Checkpoint 2, etc. For example, spawn 33 should be called “Checkpoint 33”. It doesn’t matter what the checkpoint looks like, it will still work. Also, glad I could help!
Sorry, but I’m currently trying to figure this one out to lol. I think this video might help though because it’s similar to the current script I sent: https://www.youtube.com/watch?v=c9FlUaj5akM