SetMonsterAggressive: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Disabling aggression prevents autonomous target acquisition; clear an existing target separately when required. | * Disabling aggression prevents autonomous target acquisition; clear an existing target separately when required. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
[[Category:Monster Functions]] | [[Category:Monster Functions]] | ||
Latest revision as of 09:55, 15 August 2026
setMonsterAggressive
Enables or disables autonomous targeting for a server-owned monster.
Syntax
bool setMonsterAggressive(string monsterId, bool aggressive)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
aggressive |
bool |
yes | True to enable autonomous hostility or false to make the monster passive. |
Returns
Returns true when the state is accepted; otherwise returns false.
Examples
Make a quest creature passive:
setMonsterAggressive(monsterId, false)
setMonsterTarget(monsterId, 0)
Notes
- Available only in server-side resource scripts.
- Disabling aggression prevents autonomous target acquisition; clear an existing target separately when required.