Kill tag print nil

Hello,
I 've ran into problem with kill tag for npc . The issue is whenever I kill npc , the tag print nil for some reasons . I looked everywhere but still don’t find any solution. Any help is appreciated :slight_smile:

this is the script:

for i , v in pairs(mob:GetChildren()) do
			v.Humanoid.Died:Connect(function()
				
				local tag = v.Humanoid:FindFirstChild("creator")
				
				if tag ~= nil then
					local killer = tag.Value
					print(killer)
					
				else
					print("nil")
				end
	
			end)
		end

Did u set the network ownership?

uhhhh…no , so I need to set it??

I cant say if its the problem but try puttimg
if tag then instead of if tag ~= nil then

its still print nil…(aaaaaaaaa)

Did you ever create the tag? I am just asking that because if it doesn’t exist your script will print nil.

how do I create one?? {{{{{{{{]}}}}}

Just use Instance.new() and add one to their Humanoid.

If you want to you could do this:

local killerPlayer = nil
local mob = nil
local killerVal = Instance.new("ObjectValue", mob)
killerVal.Name = "creator"
killerVal.Value = killerPlayer

Replace nil with the correct values.

Thx . I got it working :smile: