While I’ll show you how I would set up a checkpoint zone, I won’t elaborate on how you can save data, you can check out a tutorial on how to do that: https://www.youtube.com/watch?v=-wAJAI95ivs
First I would acquire the ZonePlus v2 module and install it into studio (See installation guide on how to)
https://devforum.roblox.com/t/zoneplus-v2-construct-dynamic-zones-and-effectively-determine-players-and-parts-within-their-boundaries/1017701
Then I would code the following
CheckpointVal=Instance.New("IntValue")--adds an IntVal to game
CheckpointVal.Parent = Player--sets Parent of the value to the player
--using zone v2 functions/methods/events (in this case an event) obtain Zone's modulescript in replicated storage(see installation walkthrough)
local Zone = require(game:GetService("ReplicatedStorage").Zone)
--initialize a zonegroup, i.e. checkpoints, zones must be something a player
--touches or passes through.
local Checkpoint1zone = game.Workspace.Obbymap.CheckPoint1--Location of Block in which you want the player to pass into for checkpoint1
local Checkpoint2zone = game.Workspace.Obbymap.CheckPoint2--Location of Block in which you want the player to pass into for checkpoint2
local Checkpoint1 = Zone.new(Checkpoint1zone)
local Checkpoint2 = Zone.new(Checkpoint2zone)
--categorizes the checkpointzones on map as a actual zone within ZonePlus v2 module
--Checks on player entering, who that player was
Checkpoint1.playerEntered:Connect(function(player)--obtains player
player.CheckpointVal=1 --sets val of checkpoint intval to 1
--player that entered gets their intval set to 1
end)
--and since you dont need to check if playerExited don't need to worry about it just keep checking what player enters what zone
--Checks on player entering the zone what player was it, obtains player, and puts Checkpoint2
Checkpoint2.playerEntered:Connect(function(player)--obtains player
player.CheckpointVal=2--sets val of checkpoint intval to 2
--player that entered gets their intval set to 2
end)
As I said before, I won’t elaborate on saving data, you’ll have to fetch the value of player’s checkpointval and then save it to his player id. Something along those lines, you’ll also want to fetch the player’s checkpointval and assign a spawn point to them somehow, perhaps using teams function? i.e. have checkpoints as teams and then have spawn points for those checkpoints and if this is the case, you can go ahead and just set player team to checkpoint# team on enter. IDK you do you dude