I am trying to print a simple phrase including the person who killed the player. I keep getting the error for some reason. I am guessing there is a very easy fix to this that I am not seeing.
It says the problem is on the “print(Player.Name…” was killed by"…Killer)" line.
It’s in ServerScriptService:
Players = game:GetService("Players")
Players.PlayerAdded:connect(function(Player)
print("Player Added")
Player.CharacterAdded:connect(function(Character)
print("Character Added")
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:connect(function()
print("Humanoid Died")
if Humanoid:FindFirstChild("creator") ~= nil then
local Killer = Humanoid:FindFirstChild("creator").value
print(Player.Name.." was killed by"..Killer)
end
end)
end)
end)
Any help and or guidance would be appreciated, thank you.
The code that you have above is not looking for the name of the Killer, just the instance. Try doing:
local Killer = Humanoid:FindFirstChild(“creator”).Name
That should work.
Realising there is an issue with above statement: You should just find the Humanoid’s Parent’s Name.