Tutorials

Car Door Open and Close

by Mr.Numbers (PM)

See everything made by this user or team.

Current Language: English
Very Helpful
of 9 vote(s).

Hello car fanatics! :D

This script and vehicle allows you to give your game an even better touch of greatness! :D


What this allows you to do, is make it so when a car is parked, with no one inside, the door is open. the moment you enter the car, it closes.

Then once you leave the car, it opens again :)

 

STEP BY STEP GUIDE:
1) Go to your map, make the car where you want to be, call it "0", make sure its the car with the door opened.
2) Create another car with its door closed, call it "1", make it initially not existent using the checkbox.
3) Go to car 0's options, put the following code for "Attempted to enter vehicle"


LOCAL CarX
LOCAL CarY
SET CarX = Vehicle("this").X
SET CarY = Vehicle("this").Y
SET Vehicle("0").NonExistent = 1
SET Vehicle("1").NonExistent = 0
Vehicle("1").Position2("this", CarX, CarY, 1, 0, Vehicle("this").Direction)
SET Vehicle("1").Child = "main"
SET Vehicle("1").CanMove = 1
Exit

4) Hit OK and close.
5) Open up car 1's options, put the following code for "Player exited vehicle"


LOCAL CarX
LOCAL CarY
SET CarX = Vehicle("this").X
SET CarY = Vehicle("this").Y
Vehicle("this").Exit
Vehicle("0").Position2("this", CarX, CarY, 1, 0, Vehicle("this").Direction)
SET Vehicle("1").NonExistent = 1
SET Vehicle("0").NonExistent = 0
LERP 10
SET Vehicle("this").Velocity = 0
Exit

And there you have it! :D

Tell me if there is any errors >.>

There's been a total of 3074 views(s).
There's been 2131 people that have viewed.