How do I make so the player needs to go in the obby checkpoints in order?
Asked by
4 years ago Edited 4 years ago
Hello! I'm making an obby that has checkpoints, and I want to make the player need to go to the checkpoints in order. Because I don't want hackers to teleport from the first stage to the last stage.
I tried to make my script make sense but it does not and is of course not going to actually work
I tried making this script hoping it will work but that's before finding out that it does not make sense that it will work.
01 | local part = script.Parent |
03 | part.Touched:Connect( function (hit) |
04 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
05 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
06 | local stagesnow = player.leaderstats.Stage.Value |
07 | if player.leaderstats.Stage.Value ~ = stagesnow - 1 then |
08 | stagesnow = stagesnow + 1 |
09 | player.leaderstats.Stage.Value = player.leaderstats.Stage.Value + stagesnow - 1 |
14 | script.Parent.CheckPointScript.Disabled = true |
So I am having trouble with that. What do I need to do so it can make sense?