Okay, and then when you will back, we continue?
I could help you in about 3 and a half hours, but you might want to look for help in the meantime
I’ll wait for you when you come back
And also, can I add you just in case?
Okay, anyways cya and good luck! C:
I could offer help right now if you are available
Hi again, sure, I can continue
Alright invite me to teamcreate
Okay 1 second. Oh wait, you should add me in friends
Sorry but i am just offering temporarily help i can help you with this but not anything beyond that
Since player.CharacterAdded is being connected inside PlayerAdded, each character respawn will set up a new Died event, which will lead to duplicated connections… (duplicated deaths)
local PlayerService = game:GetService("Players")
PlayerService.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local deaths = Instance.new("IntValue")
deaths.Name = "Deaths"
deaths.Parent = leaderstats
local kills = Instance.new("IntValue")
kills.Name = "Kills"
kills.Parent = leaderstats
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
deaths.Value += 1
local tag = humanoid:FindFirstChild("creator")
if tag and tag.Value and tag.Value:IsA("Player") then
local killerKills = tag.Value:FindFirstChild("leaderstats"):FindFirstChild("Kills")
if killerKills then
killerKills.Value += 1
warn(tag.Value.Name, "Killed", player.Name)
end
tag:Destroy()
end
end)
end)
end)
This should fix that.
Alright i can temporarily friend, one second
I saw that aswell but when i tested it it didn’t duplicate, he could definitely change that tho. Anyways the problem now is something beyond the leaderstats script.
Alright, I added you in teamcrate
It’s just that, that could lead to what is happening. So I went with a re-wright. Also took out that redundant health check.
SOLVED!!! Thank you very much hylas16