Prop.getVehicle 12
The Vehicle API of a vehicle placed as a prop, with everything a spawned vehicle offers: orders, damage, destroy().
Return value
| Return Type | Description |
|---|---|
| Vehicle | The 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