Its supposed to add 1 point to the leader board every time you jump. The problem is in the title.
local JumpValue = game.Players.LocalPlayer.leaderstats.Currency.Value local player = game.Players.LocalPlayer local Char = player.Character local Humanoid = Char.Humanoid Humanoid:GetPropertyChangedSignal("Jump"):Connect(function() JumpValue = JumpValue + 1 end)
local JumpValue = game.Players.LocalPlayer.leaderstats.Currency local player = game.Players.LocalPlayer local Char = player.Character local Humanoid = Char.Humanoid Humanoid.Jumping:Connect(function() JumpValue.Value = JumpValue.Value + 1 end)
This should work. Make sure it's a regular script/ServerScript inside ServerScriptService
.
game:GetService("Players").PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character.Humanoid.Jumping:Connect(function() player.leaderstats.Currency.Value = player.leaderstats.Currency.Value + 1 end) end) end)
The PlayerAdded
event fires when a player is added to the game, the CharacterAdded
event fires when the player's character is added, and the Jumped
event fires when the player jumps.