I have a checkpoint script that works but I don’t know how to fix it so where you can’t skip stages.
For an example if you are on stage 3 and you step on stage 5 it will set your stage to that number. Any tips to prevent the player from skipping stages? This is my current script:
for i,v in pairs(workspace.ObbyCheckpoints:GetChildren()) do
if v:IsA("Part") then
v.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") then
local Character = game.Players:GetPlayerFromCharacter(hit.Parent)
if Character then
local leaderstats = game.Players[hit.Parent.Name].leaderstats
if leaderstats.Checkpoint.Value < tonumber(v.Name) then
leaderstats.Checkpoint.Value = tonumber(v.Name)
end
end
end
end)
end
end