This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| 4rpl:commands:repeat [2021/01/08 16:01] – external edit 127.0.0.1 | 4rpl:commands:repeat [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| - | < | + | <= [[4rpl: |
| + | <= [[4rpl: | ||
| ====== repeat ====== | ====== repeat ====== | ||
| Line 16: | 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 | ||
| </ | </ | ||
| < | < | ||