If you want the driver to be unable to leave the vehicle, place a vehicle and set it up as following:
- Under Events, Click Add to the right of ‘Player Exits The Vehicle Send Event To’
- Click Select Device and select the vehicle device
- Click Select Function and select ‘Assigns Driver’
- Click the ‘OK’ button to save
Start the game to test. Once you get inside the car, you won’t be able to get out until you leave the game, the car blows up, or something triggers your escape.
So, how do you trigger your escape? Here’s one way I thought of and tested. Place a trigger and set it up as follows:
- Under Events, click add to the right of ‘On Triggered Send Event To’
- Click Select Device and select the vehicle device
- Click Select Function and select '‘Disable’, ‘Respawn Vehicle’, or ‘Destroy Vehicle’
- Click the ‘OK’ button to save
- Click the ‘OK’ button to save
Start the game to test. When you run over the trigger the car will let you off and either it will return to the spawn pad or disappear
There are many other methods to make this work, but this is the simplest without writing any code. Destroy Vehicle and Respawn vehicle would destroy the car for you.