SouthernGoods2 0 Posted January 8, 2021 I am placing this code into the init of a Pop-Up Alien object. I am very new to scripting so I know my syntax is probably the cause. Spoiler while { triggerActivated mt_1 } do { sleep 2; _x animate ["terc", 0]; sleep 2; _x animate ["terc", 1]; }; Share this post Link to post Share on other sites
beno_83au 1369 Posted January 8, 2021 Guessing it's due to scheduled v un-scheduled environments, and that _x reference. Worth looking into them ( scheduled/un-scheduled) if you want to understand it, but basically you cant pause a script unless it is spawned or execVM'ed, whereas code written into an object's init is called and so cannot be paused. So, spawn your code: nul = [this] spawn { params ["_object"]; while { triggerActivated mt_1 } do { sleep 2; _object animate ["terc", 0]; sleep 2; _object animate ["terc", 1]; }; }; But, that then all depends on what _x is too. So I'm assuming here that this is the only code you've got in the init? 2 Share this post Link to post Share on other sites
AnonymousSocks 1 Posted January 8, 2021 I was basing the code off some code that I found where _x was their target. I was assuming _x was just another way of using "this", so should I just replace _x with this or the variable name of the target? Share this post Link to post Share on other sites
beno_83au 1369 Posted January 8, 2021 @Christopher Ware https://community.bistudio.com/wiki/Magic_Variables This has details about _x and this, plus a few others, so have a look there. But in an object's init, this refers to the object. Share this post Link to post Share on other sites
AnonymousSocks 1 Posted January 8, 2021 Will do, thank you for the assistance! Share this post Link to post Share on other sites