Description
Adds a value to the specified stat only if the entity already has that stat; does nothing if the stat does not exist.
Parameters
| Parameter | Description |
|---|
| BaseObject | The entity whose stat is conditionally modified |
| S1 | Stat ID to modify (only applied if the entity already has this stat) |
| F1 | Amount to add (negative values are allowed) |
Examples
| Description | BaseObject | Command | S1 | F1 |
|---|
| Add 5 to Self's Hungry stat if it exists | Self | TryAddStat | Hungry | 5 |
| Subtract 10 from Target's Bladder stat if it exists | Target | TryAddStat | Bladder | -10 |
| Add 20 to Self's Energy stat only if the entity has it | Self | TryAddStat | Energy | 20 |