In this script, it creates the leaderboard, but doesn't award kills or gold. Help? No errors either.
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
money.Value = 0
money.Parent = leaderstats
local kills = Instance.new("IntValue")
kills.Name = "Kills"
kills.Value = 0
kills.Parent = leaderstats
local level = Instance.new("IntValue")
level.Name = "Level"
level.Value = 1
level.Parent = leaderstats
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character.Humanoid.Died:connect(function()
local killer = character.Humanoid:findFirstChild("creator")
if killer then
killer.leaderstats.Kills.Value = killer.Value.Kills.Value + 1
killer.leaderstats.Money.Value = killer.leaderstats.Money.Value + 3
end
end)
end)
end)
end)

1 comment
I don't have time to read through that thoroughly, but NEVER EVER EVER use two identical events in the same script! It's scary, and 100% pointless! Just use a SINGLE PlayerAdded event for everything you want done.