onElementInteriorChange | Multi Theft Auto: Wiki Skip to content

onElementInteriorChange

Client-side
Server-side
Shared

This event is triggered when the interior of an element is changed using setElementInterior.

This is a test!

Parameters

int oldInterior, int newInterior
  • oldInterior: An int representing the interior the element was in before.
  • newInterior: An int representing the interior the element is in now.

Source

element: The source of this event is the element that changed its interior.

Handler Example

local function handleOnElementInteriorChange(oldInterior, newInterior)
-- Your code here
end
-- Register the event handler
addEventHandler("onElementInteriorChange", elementAttachedTo, handleOnElementInteriorChange)

Code Examples

Demonstrates how to detect and respond to an element's interior change. Includes vehicle creation and an event handler that reports the interior transition.

local vehicle = createVehicle(411, 0, 0, 3)
setTimer(setElementInterior, 1000, 1, vehicle, 10)
addEventHandler("onElementInteriorChange", vehicle, function(oldInterior, newInterior)
outputChatBox(inspect(source).."'s interior changed from "..oldInterior.." to "..newInterior)
end)