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]
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Activating a monster if the player stands in area for certain time problem

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);


(This post was last modified: 07-18-2015, 06:32 PM by Mudbill.)
07-18-2015, 06:31 PM
Find


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



Users browsing this thread: 1 Guest(s)