Preferably with sound until conditions are met?
#1: Like would the following code
import "std.zh" int decrease_hp_amount = 4; int drain_hp_amount = 0; bool decrease_hp = false; global script what_is_needed_every_second_in_game { void run() { while(true) { if (decrease_hp == true) { if (drain_hp_amount != 5) { Link->HP -= 1; drain_hp_amount += 1; Screen->SoundPlay(SFX_HPDrain); } else if (drain_hp_amount == 5) { drain_hp_amount += 0; } } } else if (decrease_hp == false) { drain_hp_amount = 0; } Waitframe(); } } item script DrainHPPotion { void run() { while(true) { decrease_hp = true; drain_hp_amount = 5; Waitframe(); } } }
work properly or no?
If no how do I change up above code to work properly please? Thank you.
#2: What do I replace in up above code if I want Rupees drained instead of HP please? Thank you.