Type Vehicle

Vehicle

Methods

boostTimeLeft() Gets the amount of time remaining in the vehicle's boost.
cameraDistance() Returns the distance of the camera from the vehicle.
driver() Returns the driver of the given vehicle.
getHLSpeed() Returns the vehicle's current speed in Hammer units.
getMaxSpeed() Returns the maximum speed of the vehicle in miles per hour.
getPassengerSeatPoint( num ) Returns the position and angles of a passenger seat.
getRPM() Returns the vehicle's RPM value.
getSpeed() Returns the current speed of the vehicle in miles per hour.
getSteering() Returns the current steering of the vehicle.
getSteeringDegrees() Returns the current steering in degrees.
getThrottle() Gets the current throttle value.
getVehicleViewPosition( num ) Returns the view position of a given passenger.
getWheel() Gets the physics object of the given wheel.
getWheelContactPoint( wheel ) Returns the wheel contact point.
getWheelCount() Returns the number of wheels the vehicle has.
hasBoost() Gets whether the vehicle has boost functionality.
hasBrakePedal() Gets whether the vehicle has a break pedal.
isEngineEnabled() Gets whether the vehicle's engine can be started.
isEngineStarted() Gets whether the vehicle's engine is started.
isVehicleBodyInWater() Returns whether the vehicle is in water.
passenger( num ) Returns the passenger of the given vehicle.
thirdPersonMode() Returns whether the vehicle is in third person mode.


Methods

Vehicle:boostTimeLeft()
Gets the amount of time remaining in the vehicle's boost.

Environment:

Server

Return value:

    (number) Time left for boosting.
Vehicle:cameraDistance()
Returns the distance of the camera from the vehicle.

Environment:

Shared

Return value:

    (number) Distance of the camera.
Vehicle:driver()
Returns the driver of the given vehicle.

Environment:

Server

Return value:

    (Player) Driver player or nil.
Vehicle:getHLSpeed()
Returns the vehicle's current speed in Hammer units.

Environment:

Server

Return value:

    (number) Speed value, the length of the velocity vector.
Vehicle:getMaxSpeed()
Returns the maximum speed of the vehicle in miles per hour.

Environment:

Server

Return value:

    (number) Maximum speed in miles per hour.
Vehicle:getPassengerSeatPoint( num )
Returns the position and angles of a passenger seat.

Environment:

Server

Parameters:

  • num: The passenger to get, 1 is the driver.

Return values:

  1. (Vector) Position
  2. (Angle) Seat angles.
Vehicle:getRPM()
Returns the vehicle's RPM value. This may not be accurate due to the way vehicles operate internally.

Environment:

Server

Return value:

    (number) RPM.
Vehicle:getSpeed()
Returns the current speed of the vehicle in miles per hour.

Environment:

Server

Return value:

    (number) Current speed in miles per hour.
Vehicle:getSteering()
Returns the current steering of the vehicle.

Environment:

Server

Return value:

    (number) Steering value.
Vehicle:getSteeringDegrees()
Returns the current steering in degrees.

Environment:

Server

Return value:

    (number) Steering degrees.
Vehicle:getThrottle()
Gets the current throttle value.

Environment:

Server

Return value:

    (number) Current throttle value.
Vehicle:getVehicleViewPosition( num )
Returns the view position of a given passenger.

Environment:

Server

Parameters:

  • num: The passenger to get, 1 is the driver.

Return values:

  1. (Vector) View position
  2. (Angle) View angles
  3. (number) Field of view.
Vehicle:getWheel()
Gets the physics object of the given wheel.

Environment:

Server

Return value:

    (PhysObj) The physics object for the given wheel, if it exists.
Vehicle:getWheelContactPoint( wheel )
Returns the wheel contact point.

Environment:

Server

Parameters:

  • wheel: Number indicating which wheel to check.

Return values:

  1. (Vector) Contact position
  2. (number) Surface properties
  3. (boolean) Indicates if it's on the ground.
Vehicle:getWheelCount()
Returns the number of wheels the vehicle has.

Environment:

Server

Return value:

    (number) Number of wheels the vehicle has.
Vehicle:hasBoost()
Gets whether the vehicle has boost functionality.

Environment:

Server

Return value:

    (boolean) True if the vehicle can boost, false otherwise.
Vehicle:hasBrakePedal()
Gets whether the vehicle has a break pedal.

Environment:

Server

Return value:

    (boolean) True if the vehicle has a break pedal, false otherwise.
Vehicle:isEngineEnabled()
Gets whether the vehicle's engine can be started.

Environment:

Server

Return value:

    (boolean) Boolean true if the vehicle's engine can be started, false otherwise.
Vehicle:isEngineStarted()
Gets whether the vehicle's engine is started.

Environment:

Server

Return value:

    (boolean) True if the vehicle's engine is started, false otherwise.
Vehicle:isVehicleBodyInWater()
Returns whether the vehicle is in water.

Environment:

Server

Return value:

    (boolean) True if in water, false otherwise.
Vehicle:passenger( num )
Returns the passenger of the given vehicle.

Environment:

Server

Parameters:

  • num: The passenger to get. Starts at 0.

Return value:

    (Player) Passenger player or nil.
Vehicle:thirdPersonMode()
Returns whether the vehicle is in third person mode.

Environment:

Shared

Return value:

    (boolean) True if in third person.

Valid XHTML 1.0!