Adding currency after killing enemies

I’ve been stuck with this problem trying to figure out why it doesnt want to work. So im trying to do is whenever i kill an enemy/bots instead of dropping money. It will add it to my widget automatically

Bot HP and money event graph

My currency widget

This variable belongs to the enemy. It’s the enemy’s money, not the player’s.


I’d do it this way:

  • in the widget:

image

  • in the player:

  • in the enemy:

This way you update the widget only when you actually collect it, rather than 60 times per second for the rest of the game.


You can do this in the Get Text:

But it’s not good practice. See here for more info:

Ideally you’d use an Event Driven approach as outlined in #3 in the above doc.

Hello, this worked but i had to delete some of the stuff. Anyways thank you for correcting it <3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.