Jump to content
Sign in to follow this  
Wiket

Trying to make an elevator for cars and it wont work

Recommended Posts

Quote

this addAction ["elevator down"], _pos = getPos elevator; 
 
while {true} do { 
 
 if ((_pos select 2) < 20) then {
  
  _pos = getPos elevator; 
  elevator setPos [(_pos select 0), (_pos select 1), (_pos select 2) + 0.02]; 
   
 }; 
 
 sleep 0.05
  
}; 
 

 

Thats the script I am using but once the mission starts it says their is a generic error, and it just teleports the object up.

Basically I want to be able to move an elevator up and down from two different points! Thanks for any help provided!

Share this post


Link to post
Share on other sites
30 minutes ago, Wiket said:

Thats the script I am using but once the mission starts it says their is a generic error, and it just teleports the object up.

Basically I want to be able to move an elevator up and down from two different points! Thanks for any help provided!

The entire syntax is out of whack, you're closing the parameters array for the addAction command after the first parameter, of course this won't work.

Check the wiki entries for addAction and .sqf syntax.

 

Also not sure why you're naming the action "elevator down" and at the same time you're increasing the z level of the object.

 

Cheers

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×