I am just doing parkour game and i can't understand how to do it.
Here is the code:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder", player) leaderstats.Name = "leaderstats" local jumps = Instance.new("IntValue", leaderstats) jumps.Name = "Jumps" jumps.Value = 0 player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid") humanoid.StateChanged:Connect(function(_, newState) if newState.Name == "Freefall" then jumps.Value += 1 end end) end) end)
Create a value inside starterpack and just create a script that detects when the player jumps and adds 1 to the value remember to post question for help this is to help with errors not entire systems