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

How do you detect who the "killer" was?

Asked by
Bman8765 270 Moderation Voter
9 years ago

I have a game where you must survive waves of zombies, I have a gun script and a zombie. (If you want these to be added just ask, gun script aint pretty, just warning ya). Basically when the use kills a zombie I want them to rewarded something, like in-game currency or playerpoints. I know how to give them in-game currency or playerpoints but I really just want to know how do I detect who the killer was or how do I just in general reward a player for killing a zombie? (The Humanoid part in zombie is named Zombie)

1 answer

Log in to vote
1
Answered by 9 years ago

Most all weapons on ROBLOX insert an ObjectValue named "creator" into the Humanoid of something that they dealt damage to. The value of that ObjectValue will be the player that dealt the damage. From there you can go about awarding whoever dealt the damage/killed the NPC.

0
Thanks, I seem to have got this to work and is rewarding theplayers! Bman8765 270 — 9y
Ad

Answer this question