Skip to main content

Execute_TryAddStat

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

ParameterDescription
BaseObjectThe entity whose stat is conditionally modified
S1Stat ID to modify (only applied if the entity already has this stat)
F1Amount to add (negative values are allowed)

Examples

DescriptionBaseObjectCommandS1F1
Add 5 to Self's Hungry stat if it existsSelfTryAddStatHungry5
Subtract 10 from Target's Bladder stat if it existsTargetTryAddStatBladder-10
Add 20 to Self's Energy stat only if the entity has itSelfTryAddStatEnergy20