Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

detecting humanoid.creator using gun not working ?

i am trying to detect the killer when player kill an npc, my code is working when i kill the npc whith sword but if i kill the npc using a gun he does not find the killer why ?

this script in the npc:

humaniod.Died:Connect(function(health)
	local killer = humaniod.creator.Value
	print(killer.Value)
end)

3 comments

0

Can you post the sword and gun script?

0

the sword and the gun is from the tool box (its just for testing)

0

Just use the tag method

1 answer

Maybe try:

humaniod.Died:Connect(function(health)
    local killer = humaniod.creator
    print(killer.Value) -- We need this ".Value" inside the print
end)

Next time, please include all code.

1 comment

0

no hes saying its working but when he use long ranged weapon like pistol its not working

This discussion is preserved as it was. New answers, comments, and votes are closed.