How to send a kill message from the enemy to the player to count kills

Please help MEEEEEEeeeeeee

3 Likes

Have you tired using the message and mailbox behaviors?
When the enemy gets hit by a bullet or lose health, it sends a message to the player in which the message adds to a counter.

2 Likes

i have tried that but it did not not not work

I can give you a complete rundown in about an hour. Looking forward to it!

2 Likes

Ok. Here’s what you want to do:

  1. Make a mailbox block in your player. Connect it to a number (make it 1), and connect that number to another number (0) at the + sign. Name the mailbox Kill.
  2. On the enemy’s death, send a message to your player titled Kill.

Basically, the 0 number is your overall kill count. By attaching a one to the mailbox, it allows 1 to be added to that kill count. When the enemy dies, it sends a message to the player that acts as a trigger. Then it reaches the player, which triggers the 1, which adds 1 to your overall kill count.

If there’s something more complicated you’d like to add, such as text, please ask me and I’ll lead you through the steps.

3 Likes

Here’s an example of what Hihilogic has explained:

(Notes inside of the code, if you need any help ping me)

2 Likes

so the reason it did not work was that I did a smooth brain and did not label both the send message and mailbox behaviors Thank you to everyone who tried to help though you guys are amazing people!

2 Likes

Yeah that would do it :upside_down_face:
Just @hihilogic anytime you need me.
Peace! :v:

2 Likes

Yikes, a simple mistake. Well, good thing you found it!

Also, you’re welcome for trying to helping.

2 Likes

by any chance would you know how to make it so that when you reach a certain amount of kills you get an extra life?

I have 4 things to say

  1. Welcome to the community!

  2. See how this topic says that you posted 1 year later?
    image
    This is called reviving a topic since you made a reply to a 1-year-old topic. This pushes the topic back up to the top and will annoy most users. Please don’t do this again.

  3. The user you’re replying to has been offline for a few months and we don’t expect him to come back and respond.

  4. You can create your own topic to ask questions instead of just making a reply to a 1-year-old topic.

2 Likes

1 Like