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
Script Help Activating a monster if the player stands in area for certain time problem [SOLVED]
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#3
RE: Activating a monster if the player stands in area for certain time problem

(07-18-2015, 06:31 PM)Mudbill Wrote: Make it simple. The simpler the better.

After entering the area, add a timer. Upon leaving the area, remove the timer. Have the monster enable in the timer callback.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_1""SpidersHatch"false0);
}

void SpidersHatch(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1AddTimer("hatch_time"5.0f"Hatching_Timer");
    if(
alState == -1RemoveTimer("hatch_time");
}

void Hatching_Timer(string &in asTimer)
{
    
SetEntityActive("Spiders?"true);


Worked as intended, I didn't realise you can do it in such way XD Anyways, thanks a lot man!
07-18-2015, 07:01 PM
Find


Messages In This Thread
RE: Activating a monster if the player stands in area for certain time problem - by Slanderous - 07-18-2015, 07:01 PM



Users browsing this thread: 1 Guest(s)