How can I capture a KO and use that towards a leaderboard?
So I've made it when a player dies their "level" in the leaderboard goes down. How would I make it so if they kill someone it would go up? I've tried playing around with other ko leaderboard scripts but I cant seem to get it to work. Here's my code:
01 | game.Players.PlayerAdded:connect( function (player) |
02 | local leaderstats = Instance.new( "Model" ) |
03 | leaderstats.Name = "leaderstats" |
04 | leaderstats.Parent = player |
05 | local level = Instance.new( "IntValue" ) |
08 | level.Parent = leaderstats |
12 | game:GetService( 'Players' ).PlayerAdded:connect( function (player) |
13 | player.CharacterAdded:connect( function (character) |
14 | character:WaitForChild( "Humanoid" ).Died:connect( function () |
15 | local level = player.leaderstats.Level |
16 | level.Value = level.Value - 1 |