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

How do I get money per kill using magic?

Okay so I've made a magic fighting game that uses projectiles to kill others And I would like to get a money system from killing other players to use the money to unlock better moves

Problem is, any cash from kill tutorial I find only works for wielded tools like swords, and does not work with the projectiles.

any ideas?

1 answer

✓ Accepted answer

I recommend making some sort of Combat Tag inside of the player that was hit with the id of the player who casted the magic. You could check if the player already has an existing tag to prevent any more tags from being created when the player is hit. If the target is killed with a tag on them, it rewards the player, or players, associated with the tag money. After a while you can also clear the tag. Good luck!

3 comments

0

If said tag is to always be extension of an entity, then it's best you create the tag at their birth. An ObjectValue would suffice. 

0

Tags serve as a "last attacker" record, if that was not made clear. The Player instance of the attacker is written to the entity's tag upon detection of a hit.

0

Yes! Thank you for clearing that up for me.

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