I need a idea how to solve this
If the event not happen in 5sec. it breaks :>
Code:timer = 0; while(timer < 5) { do i need a if here? { self waittill("EVENT"); break; } timer += 0.05; wait 0.05; }
I need a idea how to solve this
If the event not happen in 5sec. it breaks :>
Code:timer = 0; while(timer < 5) { do i need a if here? { self waittill("EVENT"); break; } timer += 0.05; wait 0.05; }
Hi, that should work:
Code:function onlyFiveSeconds() { self endon("fiveSeconds"); while (1) { self waittill("EVENT"); self iprintlnbold("Hello in less then 5 seconds!"); } } function killThread() { wait 5; self notify("fiveSeconds"); } spawnplayer() // some random function { self onlyFiveSeconds() self killThread(); }
timescale 0.01
KillerBoB (21st December 2012)