Checkpoint System

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Making changes with my game and i wanted to do something with the checkpoint system that i have,
    the current checkpoint system i have is shows the stages on leaderstats and the new checkpoint system that im tryna do is not showing the stages u past from the leaderstats instead it shows on gui and also save system

this end up stuck in my head since im making a obby game (as of now im updating the game)
for context if u don’t understand: Checkpoint System without the Counter showing from the leaderstats but only shows on Gui with a Save feature so when playing back the obby loads where u left off

  1. What is the issue? Include screenshots / videos if possible!

  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i did but it just ends up showing different result

its fine if u send the whole script rather explaining im learning coding as of now so yeah.

1 Like

We can’t, it’s against the guidelines

For a Simple Checkpoint System, You Should Have Parts named as Numbers, for Example:
1, 2, 3 ,4

You can check if The Number above yours Is (as in Number + 1 = ExpectedNumber) The Number of the Checkpoint by using tonumber() to convert the Name into the said number:

if Checkpoints.Value + 1 == tonumber(Part.Name) then -- there might be a better way (this just might be wrong
-- code

And if so, you can set their spawn to that Checkpoint, along with adding a point to their Score.
Additionally, You may have to round that number down as it may return as a Double (With Decimals) instead of an Integer (No Decimals), so you should use math.floor() for this.

You should be using DataStoreService to Save the Players Data, although there are some easy tutorials, It’s best to go with the Advanced ones as those help prevent Data Loss from Occuring often.

It is Also good to note that you should use CollectionService or a Standard for loop to set up your stuff, rather than having a billion scripts within each part to make them function, It will make it less resource intensive and would help with performance.

As for the GUI, you can easily check for the Data:

local Checkpoints = Player:WaitForChild("Checkpoints") -- gets Value

Checkpoints.Changed:Connect(function(NewValue) -- This is used for when the Values Change
    TextLabel.Text = NewValue -- sets Text to New Value

If you want to get the Amount of Checkpoints you have its a simple thing to do:

local NumOfCheckpoints = #workspace.Checkpoints:GetChildren() -- Gets Number of Items in the Table
1 Like