tom.tucka 75 Posted December 16, 2016 HI All, I Would like to get all the doors on a hanger to close on-mission start but using this code: 0 = [getpos this, 100] spawn { sleep 0.1; { _x animate ["Door1", 1, TRUE]; _x animate ["Door2", 1, TRUE]; _x animate ["Door3", 1, TRUE]; } foreach ((_this select 0) nearObjects (_this select 1)) } This is what happens: Does anyone have a way or think they could help me fix this? Thanks In advance Tom Share this post Link to post Share on other sites
UK_Apollo 476 Posted December 22, 2016 Change to: 0 = [getpos this, 100] spawn { sleep 0.1; { _x animate ["Door1", 1, TRUE]; _x animate ["Door2", 1, TRUE]; _x animate ["Door3", 1, TRUE]; _x animate ["Door4", 1, TRUE]; _x animate ["Door5", 1, TRUE]; _x animate ["Door6", 1, TRUE]; _x animate ["Door7", 1, TRUE]; } foreach ((_this select 0) nearObjects (_this select 1)) } Assumes the hangars are CUP's, class name: Land_Ss_hangard Confirmed working via debug console using 0 = [getpos player, 100] spawn {... closes all hangar doors within 100m of player. 2 Share this post Link to post Share on other sites
tom.tucka 75 Posted December 22, 2016 26 minutes ago, UK_Apollo said: Change to: 0 = [getpos this, 100] spawn { sleep 0.1; { _x animate ["Door1", 1, TRUE]; _x animate ["Door2", 1, TRUE]; _x animate ["Door3", 1, TRUE]; _x animate ["Door4", 1, TRUE]; _x animate ["Door5", 1, TRUE]; _x animate ["Door6", 1, TRUE]; _x animate ["Door7", 1, TRUE]; } foreach ((_this select 0) nearObjects (_this select 1)) } Assumes the hangars are CUP's, class name: Land_Ss_hangard Confirmed working via debug console using 0 = [getpos player, 100] spawn {... closes all hangar doors within 100m of player. @UK_Apollo Thanks man! As Guessed other doors are 8, 9, 10 & 11 Code below will close side doors too! 0 = [getpos this, 100] spawn { sleep 0.1; { _x animate ["Door1", 1, TRUE]; _x animate ["Door2", 1, TRUE]; _x animate ["Door3", 1, TRUE]; _x animate ["Door4", 1, TRUE]; _x animate ["Door5", 1, TRUE]; _x animate ["Door6", 1, TRUE]; _x animate ["Door7", 1, TRUE]; _x animate ["Door8", 1, TRUE]; _x animate ["Door9", 1, TRUE]; _x animate ["Door10", 1, TRUE]; _x animate ["Door11", 1, TRUE]; } foreach ((_this select 0) nearObjects (_this select 1)) } Share this post Link to post Share on other sites