mossman1223 1 Posted August 13, 2014 For some reason when I try to run scripts from within the mission editor the "sleep" command doesn't work. sleep 5; hint "This message should display 5 seconds after this script is executed."; The above code displays the hint immediately, ignoring the sleep command. Any idea why? ---------- Post added at 17:34 ---------- Previous post was at 17:17 ---------- So I just figured out that when I try [] spawn { sleep 5; hint "This message should display 5 seconds after this script is executed."; }; the script works. Why is this? What does this 'spawn' command do, and why didn't the sleep function work to begin with? Share this post Link to post Share on other sites
lappihuan 178 Posted August 15, 2014 This thread explains it very well ;) Share this post Link to post Share on other sites
super-truite 54 Posted August 18, 2014 I guess that when you execute code from a trigger for instance, it is like using "call". Which forbids the use of "sleep". there are some subtleties though: see the notes at the bottom of the Biki page for "call". PS: I don't understand the concept of non-scheduled/scheduled environment discussed in the above-mentionned page. Anyone? Share this post Link to post Share on other sites