(08-17-2011, 10:52 PM)palistov Wrote: Try this looping timer.
bool bMonsterActive = false;
void MonsterStuff(blahblah blahblah)
{
SetEntityActive("grunty", true);
PlayMusic("gruntymusic.ogg", true, 1, 0, 0, true);
bMonsterActive = true;
AddTimer("", 5, "MonsterCheck");
}
void MonsterCheck(string &in timer)
{
bMonsterActive = GetEntityExists("grunty") ? true : false;
if(!bMonsterActive) PlayMusic("newmusic.ogg", true, 1, 0, 0, 0, true);
AddTimer("", 5, "MonsterCheck");
}
What I was thinking is something like that, but that requires to check whether monster seeing the player, or chasing the player. Requires more work, which I don't feel like doing lately.
Well, thanks for the help all!