My leaderboard Value is the Weight's Level. But it won't update, even if the Weight's Value grow, the leaderboard's Value doesn't grow. It's because the leaderboard's Value was set when the Weight's Value was 1. I want to make an updated leaderboard so that when the weight updates ( grow ), the leaderboard also updates ( grow ). Here is my script for some infos:
local level = Instance.new("NumberValue") level.Name = "Level" level.Parent = leaderstats level.Value = game.StarterPack.Weight.Level.Value
So I created the leaderboard but when the game.StarterPack.Weight.Level.Value changes, the leaderboard doesn't. Thank you for reading this, please help me because I need to know how to make this to make my game.
game.Players.PlayerAdded:Connect(function(player) -- You have to have the player local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local level = Instance.new("NumberValue") level.Name = "Level" level.Parent = leaderstats level.Value = player.Backpack.Weight.Level.Value player.Backpack.Weight.Level.Value.Changed:Connect(function() -- Function when changed. level.Value = player.Backpack.Weight.Level.Value end) end)
Everything in StarterPack is replicated to the player's backpack, so you need to get it from there. I didn't test this, so there are probably errors in it. I hope you get the idea.