Skip to content

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.

objects.setMaterials(id: number, materials: readonly ScriptObjectMaterial[]): Promise<ActionResult>
Name Type Description
id number The ID from objects.create.
materials readonly ScriptObjectMaterial[] Up to eight distinct slots per object.

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).

gamemodes/my-mode.ts
import { objects } from "nativemp";
const signId = 268435457;
await objects.setMaterials(signId, [{ slot: 0, colorRgba: 0xF2A65AFF }]);