objects.setMaterials
Replaces the object’s list of material overrides. An empty list restores the original materials. Use a stock GTA:SA texture by its dictionary and texture names.
Signature
Section titled “Signature”objects.setMaterials(id: number, materials: readonly ScriptObjectMaterial[]): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from objects.create. |
materials |
readonly ScriptObjectMaterial[] |
Up to eight distinct slots per object. |
Returns
Section titled “Returns”An ActionResult. applied means the server stored the settings. The game keeps the original texture if it cannot find the replacement, and skips slots the model lacks. Invalid entries are rejected. Limits return object-material-slot-limit or object-material-limit (1,024 customized objects).
Example
Section titled “Example”import { objects } from "nativemp";
const signId = 268435457;await objects.setMaterials(signId, [{ slot: 0, colorRgba: 0xF2A65AFF }]);