Help with my obby

  1. What do you want to achieve?
    Stages that when i step on them, it updates to the stage they’re on.

  2. What is the issue?
    if the player missed a stage and went beyond the stage they was on, it updates to that stage. I want it so it only updated if you’re on THAT current stage.

e.g. Im on stage 3 but i missed 4 and went to 5, it updates to 5

My current code for the stages:

for _, checkpoint in pairs(stages:GetChildren()) do
		if hit.Parent:FindFirstChild("Humanoid") then
			local player = game.Players:GetPlayerFromCharacter(hit.Parent)
			local stageNumber = tonumber(checkpoint.Name)
			local Stage = player.leaderstats.Stage

			if Stage.Value < stageNumber then
					Stage.Value = stageNumber

Just check if the player’s next stage is equal to the stage of the checkpoint, by adding one to their current stage value.

if Stage.Value + 1 == stageNumber then
	Stage.Value = stageNumber
1 Like

Thank you very much, I honestly got confused when I made this.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.