how would i make a checkpoint system where when you touch a part you have your spawn set there so when you die you come right back. While also having a spawn when you first join which is the same as other peoples.

also maybe can someone let me know how i can make a save system so when you leave the game you come right back to the spot you left at. Im not that great at datastores.

9 comments

0

You want a tutorial?

0

Yes please that would be nice

0

The Checkpoint affect is given by assigning the 'RespawnLocation' attribute of the Player that made contact with the respective SpawnLocation Instance. Normally, these are all stored with an ascending name-base of "Checkpoint{#}" within a Folder in workspace.

0

Each Player is given a "Stage" (IntValue) leaderstat that corresponds to the current Checkpoint number. With it, it is used to affirm the legitimacy of the Checkpoint claim, by checking whether or not the mathematical evaluation of:

0

CheckpointNumber - Stage.Value == 1

0

Proves true. This simply affirms whether or not the contacted SpawnLocation is one further than the current allocated Checkpoint; ultimately preventing Checkpoint-jumping.

0

For ease, we iterate over all "Checkpoint" Instances within the folder to a). Determine 'CheckpointNumber', and b). Initiate the collective Touch response Callback.

0

For Checkpoint Persistence, you can simply create a GlobalDataStore to track the Checkpoint Value of the Player's who left; check to see whether it is above zero or less than the total stage count to set. This way you're not storing a Stage of 0 (Spawn) and allowing others to return to the win-zone every time; I suggest you call ':RemoveAsync()' at this time to eradicate their Checkpoint track.

0

This will allow them to restart. Likewise, use ':IncrementAsync' on the GlobalDataStore, and a ':GetAsync' affirmation to load an existing stage track.