Good Afternoon! My name is Abel and I’m a beginer in this world, so I need some help…
I have made a GUI with some buttons, and one of that have the function to decrease the health of a monster, but if you press the button fast, you can kill the monster in less that 1 second, so I want to ask how I can do a delay mecanism that activate itself after pressing the attack button and doesn’t allow you to press the button again before the delay finish. I tried to do it with a for that contains a waitForSeconds, inside the button code (if()), but it doesn’t work.
And also I have another little question. I have a mana bar that decrease when pressing a button in my game and i want to create a progressive decreasing bar, I mean, I want it to decrease slowly, and not to make the bar smaller instantaneously after pressing the button. Is it clear?
The button is only a if(GUI.Button(Rect(x, y, x, y), “”)) States.mana-10;, and there is a mana bar which width is given by this State.mana var.
Thank you a lot!
Abel!