Why Isn't This Jump Script Working?

Hello developers, I’ve recently made a script that will increase your jump value on the leaderboard and your jump power each time you jump, however, it does not work.


 local player = game.Players.LocalPlayer

local character = player.Character

local humanoid = character.Humanoid

local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats")

humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
	
	leaderstats.jumps.Value = leaderstats.jumps.Value + 1
	
	humanoid.JumpPower = humanoid.JumpPower + 1
end)

If somebody knows the solution to this, please leave a reply.

Thanks!

From what I assume, you’re using a localScript as you can only access the LocalPlayer from them. However, this means that you’re on the client, and because of FilteringEnabled, you’ll have to change the values on the server. To do this, you’ll have to fire a RemoteEvent to the server every time somebody jumps

On the other side, you could simply run this on a script from the server and you can get the player on the server with a PlayerAdded Event.

1 Like