Prop.getVehicle ▲ 12

Available from Easy Red 2 2.1.1

The Vehicle API of a vehicle placed as a prop, with everything a spawned vehicle offers: orders, damage, destroy().


Return value

Return TypeDescription
VehicleThe vehicle, or nil for a prop that is not a vehicle or before it is spawned.

No parameters defined for this function.


Examples

A placed vehicle that blows up later

-- on a vehicle placed as a prop: five minutes in, it explodes
sleep(300)
local vehicle = myself:getVehicle()
if vehicle then
    vehicle:destroy()
end

Back to Scripting API