How do I get a weapon's name whenever someone died by that person's weapon they're holding.
(Replicated Storage)
local event = game.ReplicatedStorage.TheyDiedLol
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char:WaitForChild("Humanoid").Died:connect(function(killed)
local killer = char.Humanoid:FindFirstChild("creator")
if killer.Value then
local killerName = killer.Value.Name
event:FireAllClients(plr, killerName)
end
end)
end)
end)

2 comments
I forgot to say that I didn't include the weapon code because I legit have no clue how to get the weapon's name from the person's character
Forgot to also say so sorry for the person who answered first... All of this will display in the StarterGUI saying plr killed by plr using (WEAPON)