How do you make a Jump counter leaderboard?

when i jump it does nothing.

I think the event is called StateChanged, and not StateChange. Put a “d” at the end and it should be fixed

1 Like

image
put a d at the end of this?

1 Like

yes. (30characarters34421gfhfgh

works! but VERY unresponsive. I did 20 jumps and it said I did 4

example of that:
robloxapp-20200322-1208291.wmv (4.1 MB)

Maybe this way will work better:

player.CharacterAdded:Connect(function(character) 
local humanoid = character:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if humanoid.Jump == true then
jumpCount.Value = jumpCount.Value + 1
end
end)

Replace your old character added function to this, and let me know if it works.

its great but look. I did 5 jumps but it gave me 7.
robloxapp-20200322-1243103.wmv (903.8 KB)

image

when held space bar it gives 2 per jump

Maybe add a cooldown? Like this:


player.CharacterAdded:Connect(function(character) 

local humanoid = character:WaitForChild("Humanoid")
local debounce = true

humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if debounce == true then
debounce = false
if humanoid.Jump == true then
jumpCount.Value = jumpCount.Value + 1
end
wait(0.2)
debounce = true 
end
end)

like that? image

Yep, this would give it an 0.2 second cooldown. Maybe the problem was that it sometimes fires twice rapidly.

but now the leaderboard wont show.

Can you show me a video? That’s weird.

Oh, nothing is ending the character added function. Put another end) at the end of your script.


image

Put another end) at the end, the player added function also isn’t closed. Forgot about that

Input from the spacebar changes the state of humanoid to jumping, which will cause unreliability in the script. Try using Humanoid.FloorMaterial, as stated earlier.

1 Like

like this?

	    game.Players.PlayerAdded:Connect(function(player)
		    local leaderstats = Instance.new("Folder")
		    leaderstats.Name = "leaderstats"
		    leaderstats.Parent = player 

		    local jumpCount = Instance.new("IntValue")
		    jumpCount.Name = "Jumps"
		    jumpCount.Parent = leaderstats

		    player.CharacterAdded:Connect(function(character) 

		    local humanoid = character:WaitForChild("Humanoid")
		    local debounce = true

		    humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
		    if debounce == true then
		    debounce = false
		    if humanoid.Jump == true then
		    jumpCount.Value = jumpCount.Value + 1
		    end
		    wait(0.2)
		    debounce = true 
		    end
	    end)
    end)
end)
1 Like

Yeah, if it still isn’t reliable try something that someone else suggested.

1 Like