I created a system to know who killed whom, you can put that in any power, weapon, swords, whatever you want, to know who will kill and who helped to kill the target
Is very simple to use, you only need put that script on NPC, Player whatever you want
local kdA = require(game:GetService("ServerStorage").Modules.Kda)
--That is in case of NPC, players will be player.Character.Humanoid.Died
script.Parent.Humanoid.Died:Connect(function()
if kdA.GetCo(script.Parent.UserId.Value) ~= nil then
--kdA.Get(id)["Name"], unpack(kdA.GetCo(id)
warn("SANS DIED BYE "..kdA.Get(script.Parent.UserId.Value)["Name"]..unpack(kdA.GetCo(script.Parent.UserId.Value)))
else
warn("SANS DIED BYE "..kdA.Get(script.Parent.UserId.Value)["Name"])
end
end)
And to use on yours skills, spells, etc, you only need do that
local KDa = require(game:GetService("ServerStorage").Modules.Kda)
-- KDa.attackedPlayer(victm ID,agressor ID,agressor.Name)
KDa.attackedPlayer(val:FindFirstChild("UserId").Value,Player.UserId,Player.Name)
That is the link Kda - Roblox