#Player Kills aren't syncing to leaderstats and physical leaderboard

3 messages · Page 1 of 1 (latest)

frank axle
#

I have a Physical global leaderboard and leaderstats, but for some reason when a player kills another player with a sword, the kill won't count and it won't add +1 value (value being a kill) to leaderstats. I have the physical global leaderboard synced with the leaderstats but i can't get the kills to be counted when a player kills another player. I was only able to get 10 kills from using a command (;add <player> Kills <value>). Is there anyway that someone could help me with this? If we go to dms I might be able to pay someone to help me write the script or something. Please help :)

sly shore
#

intvalue.Changed ?

frank axle
# sly shore intvalue.Changed ?

`function humanoiddied(player,humanoid)

local killervalue = Instance.new('ObjectValue',humanoid)
killervalue.Name = 'Killer'

humanoid.Died:Connect(function()
    local killer = humanoid:FindFirstChild('Kills')
    if killer then
        if killer.Value == nil then return end
        local kills = killer:FindFirstChild('Kills',true)
        if kills then kills.Value += 1 end
    end
end)

end

game.Players.PlayerAdded:Connect(function(player)

repeat wait() until player.Character

local Template = Instance.new("BoolValue")
Template.Name = "leaderstats"

local killsvalue = Instance.new("IntValue", Template) ; killsvalue.Name = 'Kills'
killsvalue.Parent = Template

humanoiddied()
player.CharacterAdded:Connect(function(character)
    humanoiddied(player , character:WaitForChild('Humanoid'))
end)

end)`