I have already made a gui that tells you who youve been killed by but it does not tell the killer who they killed. Would it be a simple change/fix?
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character.Humanoid.Died:connect(function()
local Tag = Character.Humanoid:FindFirstChild("creator")
if Tag ~= nil then
local Gui = script.KillGui:Clone()
Gui.Parent = Player.PlayerGui --Put this first
Gui.TopFrame.TextLabel.Text = ""..Tag.Value.Name..""
end
end)
end)
end)
Detecting who the player has killed depends on how you manage killing players in the game.
Is this a weapon? If so then I suggest reading through the code for this weapon and locating the section where it handles the opponent being damaged/killed.
If I understand correctly, you want the killer to know the name of his victim. This is quite easy to do. (I did not check, but it should be something like this)
humanoid.Died:Connect(function() -- humanoid = killed hum
local killer = humanoid:findFirstChild("creator").Value -- killer
local gui = script.KillGui:Clone()-- your GUI
gui.Parent = killer.PlayerGui
gui.TopFrame.TextLabel.Text = "You killed: "..humanoid.Parent.Name --name of the character
end)