Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help: if HasItem, spawn monster
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#6
RE: need help: if HasItem, spawn monster

Or you could make it really easy.
void OnStart()
{
    AddEntityCollideCallback("Player", "CollideArea", "MonsterScare", false, 1); // This will activate every time the player enters the area.
}
void MonsterScare(string &in asParent, string &in asChild,  int alState)
{
    if(HasItem("Key")) // Checks if the player has the key
    {
    // Monsterstuff goes here. SetEntityActive and whatnot.
    SetEntityActive("CollideArea", false);// This gets rid of the area, so the script will only run once.
    }

// If the player doesn't have the key, nothing happens.
}

02-06-2012, 07:56 AM
Find


Messages In This Thread
RE: need help: if HasItem, spawn monster - by Obliviator27 - 02-06-2012, 07:56 AM



Users browsing this thread: 1 Guest(s)