Why My Script Cant it Send a Event in a player?

im Trying to make it when a player kills a npc, it triggers a event to the player that killed the npc
it dosen’t seem to work, how can i fix this issue

thanks.

local Humanoid = script.Parent:WaitForChild("Humanoid")

Humanoid.Died:connect(function() 
	local Killer = Humanoid:findFirstChild("creator") 
	if Killer ~= nil then 
		if Killer.Value ~= nil then 
			game.ReplicatedStorage:FindFirstChild("DisplayKill"):FireClient(Killer) 
		end 
	end 
end)


The Value property of Killer is the reference to the player object, it seems it might’ve just been a typo.

local Humanoid = script.Parent:WaitForChild("Humanoid")

Humanoid.Died:connect(function() 
	local Killer = Humanoid:findFirstChild("creator") 
	if Killer ~= nil then 
		if Killer.Value ~= nil then 
			game.ReplicatedStorage:FindFirstChild("DisplayKill"):FireClient(Killer.Value) 
		end 
	end 
end)

1 Like

i cant belived this, im so dumb lol
thank you

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.