I barely started learning about leaderboards and i want to know how can you record kills. This is what i got. I don't know what to go from there
game.Players.PlayerAdded:connect(function(player) local stat = Instance.new("IntValue", player) stat.Name = "leaderstats" local money = Instance.new("IntValue",stat) money.Name = "Money" money.Value = 20 local kills = Instance.new("IntValue",stat) kills.Name = "Kills" kills.Value = 0 end)
Well, now that you have set up the leaderboard statistics for the player, you can now add a function that checks when the player gets a kill. The kill-checking script should be inside of the weapon that the player will be using. Preferably, after changing the health values in the weapon's script, have it check if the target died from that health value change (if Humanoid.Health <= 0 then)