Garry's Mod Wiki

Player:EnterVehicle

  Player:EnterVehicle( Vehicle vehicle )

Description

Force puts the player into a specified vehicle. This does not bypass GM:CanPlayerEnterVehicle.

Arguments

1 Vehicle vehicle
Vehicle the player will enter

Example

Enters the player into the vehicle they're looking at

local jeep = Entity( 1 ):GetEyeTrace().Entity Entity( 1 ):EnterVehicle( jeep )