Im pretty new to scripting so im trying to learn right now so i tried making an obby as my first game and I dont understand how you would make a gamepass script based on this script. I followed along with the video to get my checkpoint system and saving system so when the player leaves it saves their game.

Checkpoint system : https://www.youtube.com/watch?v=Aa83VYif6VA&t=278s Checkpoint saving system : https://www.youtube.com/watch?v=vobF8wCyl6U&t=167s

Now that I am trying to make a gamepass Im not sure how you would say, if the player buys the gamepass then change the stage to the next stage in code. I already tried putting a block on top of the checkpoints and disabling cancollide and transparency and put a value on it so when you purchase the gamepass the value increases by 1 and you teleport to the next block it that messed up my leaderboard. So im stuck and not sure what to do.

Here, the game if you wanted to try it out : https://www.roblox.com/games/4893343068/Cannibal-Candy-RESET-BUTTON