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)
I think the problem has to be in the third function. Try this:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character.Humanoid.Died:connect(function(chr) -- I gave this function a parameter local killer = chr.Humanoid:findFirstChild("creator") -- switched character to chr if killer then killer.leaderstats.Kills.Value = killer.Value.Kills.Value + 1 killer.leaderstats.Money.Value = killer.leaderstats.Money.Value + 3
Hope this helps.