Quote:
Originally Posted by cbkbud
I know that. When noone is in the level, the NPCs sleep. They don't do anything. The timeout stops, etc.
|
Maybe you could set a variable like this:
PHP Code:
function onCreated()
{
if (this.initiate)
{
//...
}
setTimer(0.05);
}
function onTimeout()
{
if (playerscount == 0)
{
this.initiate = false;
} else {
this.initiate = true;
}
if (this.initiate)
{
// Do whatever code you want.
}
setTimer(0.05);
}
( I feel as though i've made a mistake in the above code, but it looks fine ... )