Results 1 to 3 of 3

Thread: About doors :)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Code:
    // create a prefab (new map)
    // model your door -> script_model or script-brushmodel
    // select your trigger first then your door hit W (arrow from trig to door appears)
    // save it and paste this prefab as many times as you like in your map
    
    init()
    {
    	doorTrigs = getEntArray( "targetname" , "trigger_door" ); // maybe switch params
    
    	for( i = 0 ; i < doorTrigs.size ; i++ )
    	{
    		if( !isDefined( doorTrigs[i].target ) )
    			continue;
    
    		door = getEnt( doorTrigs[i].target , "targetname" ); // maybe switch params
    
    		if( !isDefined( door ) )
    			continue;
    
    		doorTrigs[i] thread doorThink( door );
    	}
    }
    
    doorThink( door )
    {
    	while( isDefined( self ) )
    	{
    		self waittill( "trigger" , player );
    
    		door rotateYaw( 90 , 1.0 );
    
    		door waittill( "rotatedone" );
    
    		self waittill( "trigger" , player );
    
    		door rotateYaw( -90 , 1.0 );
    
    		door waittill( "rotatedone" );
    	}
    }

  2. The Following 3 Users Say Thank You to serthy For This Useful Post:

    kung foo man (1st February 2014),pollo (2nd February 2014),smect@ (2nd February 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •