15.10.2016, 07:22
Quote:
|
Hey,
If you would like to press a button near it, you will need to use OnPlayerKeyStateChange Here you will need to check if the player presses the key you want to use, and if it is pressed check if player is near the gate. You can easily do this by using the IsPlayerInRangeOfPoint function. You'll also have to create an object for the gate. You'll need to use this in functions later so you'll need to assign it to a variable (for example: gate = CreateObject/CreateDynamicObject). You should take a look at the following function to move the object (close/open the gate): MoveObject (if you use streamer, use MoveDynamicObject. Before moving the object you need to get it's current position to see whether the gate should be closed or opened. You can simply check if the object ID's position is not equal to open XYZ for instance, if not move it to the open XYZ, if else move it back to closed XYZ. There are probably countless tutorials on the forums on how to do this but this is hopefully helpful as well. |


