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:

NameTypeDescription
sidnumThe 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:

NameTypeDescription
aidstrAsset ID for the AI model
namestrDisplay name for the AI
xnumX spawn position
ynumY spawn position
znumZ spawn position
dataobjAdditional AI configuration (respawnT, respawnR, targAI, targPlr, friendly)

Returns: obj - The spawned AI object

obj result = GAME.AI.spawn("asset_id", "name", 0, 10, 0, {});