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

How do I get money per kill using magic?

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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!

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.  Ziffixture 6913 — 2y
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. Ziffixture 6913 — 2y
0
Yes! Thank you for clearing that up for me. plooring 96 — 2y
Ad

Answer this question