Whenever JumpPower on the character is increased the leaderboard doesn't update. Is there something i'm missing?
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local leaderstats = Instance.new('Folder') leaderstats.Name='leaderstats' leaderstats.Parent = player local jumpPower = character.Humanoid.JumpPower local height = Instance.new('IntValue') height.Value = 0 height.Parent = leaderstats height.Name = 'Height' local jump = Instance.new('IntValue') jump.Value = jumpPower jump.Parent = leaderstats jump.Name = 'Jump' end) end)
Ok, so when you put the character's jumppower into a variable, it only stores the current jumppower it is at when you create that variable, it doesn't update it, so to fix this you should directly use the characters jumppower like this. Also you should do a :Changed() function
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local leaderstats = Instance.new('Folder') leaderstats.Name='leaderstats' leaderstats.Parent = player local jumpPower = character.Humanoid.JumpPower local height = Instance.new('IntValue') height.Value = 0 height.Parent = leaderstats height.Name = 'Height' local jump = Instance.new('IntValue') jump.Value = character.Humanoid.JumpPower jump.Parent = leaderstats jump.Name = 'Jump' character.Humanoid.Changed:connect(function(what) -- everytime it changes yeah if what == "JumpPower" then jump.Value = what.Value end end) end) end)