Here is my script
import "std.zh"
int BombX = 0; //BombX will be at X position of wherever Link places a Bomb
int BombY = 0; //BombY will be at Y position of wherever Link places a Bomb
item script IfPotion1BlueIsBWeaponItem
{
void run()
{
if (GetEquipmentB() == 29)
{
if ( Link->PressB )
{
while(Game->Counter[CR_LIFE]!= 0)
{
Game->DCounter[CR_LIFE] = Game->Counter[CR_LIFE]-1;
Waitframe();
}
}
}
}
}
Here is my script
import "std.zh"
int BombX = 0; //BombX will be at X position of wherever Link places a Bomb
int BombY = 0; //BombY will be at Y position of wherever Link places a Bomb
item script IfPotion1BlueIsBWeaponItem
{
void run()
{
if (GetEquipmentB() == 29)
{
if ( Link->PressB )
{
while(Game->Counter[CR_LIFE]!= 0)
{
Game->DCounter[CR_LIFE] = Game->Counter[CR_LIFE]-1;
Waitframe();
}
}
}
}
}
DCounter is fine, it means drain counter. But 1 is just 1/16 of a heart. Try 16.
The problem is that this is an item script. It can only run for one frame, so, as soon as it encounters the Waitframe() instruction, it exits.
It's only filling a small amount of HP, then exiting, and, if it is attached to a potion class item, it's being removed on use; unless you adjust the defaults.
I don't really know zscript, but in the first part of this line you have "DCounter" while it appears it should just be "Counter":
Game->DCounter[CR_LIFE] = Game->Counter[CR_LIFE]-1
If the item is disappearing after use then the item is probably set as a consumable in the item editor.
It looks to me as the OP wants a refill rate that increases in speed as it refills? (Else, I'm not sure on the point of this)
In theory, that's what'd happen here, if the script could run for multiple frames. An ffc, or a global script, is what you need for this type of event.