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:
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local level = Instance.new("IntValue")
level.Name = "Level"
level.Value = 0
level.Parent = leaderstats
end)
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
local level = player.leaderstats.Level
level.Value = level.Value - 1
end)
end)
end)

1 comment
a question ive been dying to get answered