I need a script that can give a kill to the person who killed them on an attack that is from ReplicatedStorage.
The attack can tell who owns the attack by using a value, (which is used for not harming the owner of said attack) however I don’t know how to make the script find the attack let alone the owner off of the attack’s value.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character.Humanoid.Died:Connect(function()
if Character.Humanoid:FindFirstChild("creator") then
local Attack = Character.Humanoid.creator.Value
print(Attack)
local Player = Attack.Owner.Value
print(Player) --these two don't print anything.
local Leaderstats = Player.leaderstats
Player.leaderstats:FindFirstChild("Kills").Value = Player.leaderstats:FindFirstChild("Kills").Value + 1
end
end)
end)
end)
The tool that’s being used summons an attack that’s cloned from ReplicatedStorage. I looked around for alternatives on the forum and couldn’t find much. I snagged a bit of this code off of the forum to work differently than my previous code which was used in a Zombie FPS of mine.