Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

detecting humanoid.creator using gun not working ?

Asked by 4 years ago
Edited 4 years ago

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)
0
Can you post the sword and gun script? BashGuy10 384 — 4y
0
the sword and the gun is from the tool box (its just for testing) belalg1 9 — 4y
0
Just use the tag method Clasterboy 72 — 4y

1 answer

Log in to vote
0
Answered by
BashGuy10 384 Moderation Voter
4 years ago

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.

0
no hes saying its working but when he use long ranged weapon like pistol its not working tamor46 12 — 4y
Ad

Answer this question