The addHpUpTrigger native AI script function registers a trigger on HP increases. Whenever the HP level of a bot upcrosses the threshold, it triggers the specified user event or script function. Several triggers can be registered on the same group, even with the same threshold and event.
()addHpUpTrigger(threshold: f, user_event_n: f) // addHpUpTrigger_ff_
()addHpUpTrigger(threshold: f, callback: s) // addHpUpTrigger_fs_
()addHpUpTrigger(0.5, 4);
This example code registers a trigger that will trigger user event 4 when the HP level of a bot crosses 0.5.
()addHpUpTrigger(0.5, "onHPIncrease");
This example code registers a trigger that will call the "onHPIncrease" script function when the HP level of a bot crosses 0.5.