This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 4rpl:commands:repeat [2021/12/23 19:28] – Karsten75 | 4rpl:commands:repeat [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| trace(< | trace(< | ||
| <-y sub(1) -> | <-y sub(1) -> | ||
| + | endwhile | ||
| + | </ | ||
| + | <code 4rpl> | ||
| + | # UNIT SCRIPT | ||
| + | |||
| + | # This script increases the max health of the unit over time. | ||
| + | # The script won't be stuck in the loop since it's limited by the unit's | ||
| + | # Health regen rate or " | ||
| + | |||
| + | while(GetUnitHealth(self) GetUnitMaxHealth(self) eq) #If unit's current health is equal to it's max health... | ||
| + | repeat | ||
| + | SetUnitMaxHealth(self GetUnitMaxHealth 0.5 add) #Add 0.5 points of max health to the unit | ||
| + | SetUnitDebugText(self Concat(" | ||
| endwhile | endwhile | ||
| </ | </ | ||
| < | < | ||