Tutorial:How to use VehicleSeats

Before you do this tutorial, it is strongly recommended to read VehicleSeats.

Let's add a script to make things happen when you drive your vehicle.

Now, create a script and place it into a VehicleSeat.

The first thing we want is to detect constantly what is happening to the special properties of a VehicleSeat and make the script do something once one of them is a certain value.

To make a constant script, that runs endlessly, we're going to start it with a loop. To start an endless loop, type the following into your script. Don't forget to add the keyword "end" to your loop or else it won't work:

Now, since we don't want this loop to repeat faster than possible and crash the game, we add a "wait". The wait can be used to delay the script for a certain amount of time. Once you add a wait to a loop, it will run every time the wait ends. To add a wait, simply type wait above what you wish to delay, what goes in the 's is the number of seconds you wish to be delayed.

The script should now look like this:

Now let's start with the IF's. The "if" can be used to determine if something is equal to, is greater than, less than, and not equal to. These IF's'' will finish up the script. Also, inside the IF's is where we tell the seat to move and do stuff.''

Now, we're going to include "locals". Declaring something as a local makes it much easier to type and shortens up and makes scripts much easier to use. Here's what it should look like once we add these:

Now, hop on your seat and begin to drive with the arrow keys, and watch what happens to the seat!