import "std.zh" int ActivateDrainLinkHPToZeroScript = 0; item script IfPotion1BlueIsBWeaponItem { void run() { while (Game->Counter[CR_LIFE]!=0) //as long as life is not equaling 0 { ActivateDrainLinkHPToZeroScript = 1; //make ActivateDrainLinkHPToZeroScript active } } } //v used on Active: global script DrainLinkHPToZeroScript { void run() { while (ActivateDrainLinkHPToZeroScript == 1) //as long as ActivateDrainLinkHPToZeroScript = 1 { while(Game->Counter[CR_LIFE]!=0) //as long as life is not equaling to 0 { Game->DCounter[CR_LIFE] = -4; //drain life by one fourth of a heart Game->PlaySound(23); //play Refill sound } } } } //v Used only onExit: and onContinue: global script MakeActivateDrainLinkHPToZeroScriptEqualToZero { void run() { ActivateDrainLinkHPToZeroScript = 0; //ActivateDrainLinkHPToZeroScript make up above global script no longer become used because ActivateDrainLinkHPToZeroScript is equaling to 0 instead of 1 } }
What exactly must I change up above code so that in global script while
ActivateDrainLinkHPToZeroScript is equaling 1 LIFE gets drained by one fourth of a heart until Link's HP is equal to 0?