AI
AI entity spawning and management.
Availability: Client & Server
Methods
AI.list
client server
Get an array of all AI entities in the game (server-side only)
Signature: obj[] action()
Returns: obj[] - Array of AI objects
obj[] items = GAME.AI.list();
AI.remove
server
Remove an AI entity by its session ID (server-side only)
Signature: action(num)
Parameters:
| Name | Type | Description |
|---|---|---|
sid | num | The AI session ID to remove |
GAME.AI.remove(0);
AI.spawn
server
Spawn a new AI entity (server-side only)
Signature: obj action(str, str, num, num, num, obj)
Parameters:
| Name | Type | Description |
|---|---|---|
aid | str | Asset ID for the AI model |
name | str | Display name for the AI |
x | num | X spawn position |
y | num | Y spawn position |
z | num | Z spawn position |
data | obj | Additional AI configuration (respawnT, respawnR, targAI, targPlr, friendly) |
Returns: obj - The spawned AI object
obj result = GAME.AI.spawn("asset_id", "name", 0, 10, 0, {});