Skip to content

vehicleAppearanceChanged

Tells your gamemode that a vehicle’s look changed and every player sees it: your gamemode set it, a player changed it in a mod shop or paint shop and you allowed it, the game fitted a lowrider’s own hydraulics (some come with them), or your vehicle respawned with the look you created it with. vehicles.getAppearance already returns the new look.

server.on("vehicleAppearanceChanged", ({ vehicleId, fromAppearance, toAppearance, changeSource, player, observedAtSessionMs }) => void)
Name Type Description
vehicleId number The vehicle’s network ID.
fromAppearance VehicleAppearance The look before.
toAppearance VehicleAppearance The look now.
changeSource "script" | "game" | "respawn" Your gamemode, the game (a player in a shop, or hydraulics the game fitted to a lowrider by itself), or a respawn.
player PlayerSnapshot | null The player who made a "game" change in a shop; null for hydraulics the game fitted by itself, and for the other sources.
observedAtSessionMs number When the server saw the change, on the shared session clock.
gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("vehicleAppearanceChanged", ({ player, toAppearance, changeSource }) => {
if (changeSource === "game" && player) server.log(`${player.name} tuned a car: ${toAppearance.components.length} parts`);
});