Help with making a power?

So i want to make a power that has a certain amount of “charges”
my character is a lightbulb and i want him to use a set amount of electrocution charges, which can move things to solve a puzzle. the ability to electrocute things by clicking things has been made already but i want to set a limited amount. how?

link: Flowlab Game Creator - You Are the Light

2 Likes

You could use this, although I’m not entirely sure what all you wanted, so I kind of threw some messaging behaviors in there in case you wanted the charge to have an effect on something so you can send a message to it when it happens, which is the “output” message.

Also I don’t know if you are planning on adding a recharge system, but I figured that when you run out of charges you could use some sort of recharge or do you just lose the game?

Anyway the example I showed should turn the switch off after 5 uses, which you can change the number depending on how many charges you prefer the player to have. And it will have a cooldown of 1 second so you can’t spam them in one go or something. Like I said, I wasn’t at all sure what you wanted for it, so I just added the messages to help show how you can incorporate it for puzzles or whatnot.

1 Like

that looks really good, I wasn’t going to do a recharge system, just restart if you fail, and I could use a global value to see how many charges you have right?

2 Likes

Yeah, a global might be better than using messages since it’s not as much work. So it should work.

1 Like