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 Display message when player tries to use lantern
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#5
RE: Display message when player tries to use lantern

PHP Code: (Select All)
void OnStart()
{
    
AddTimer("tmr_check"0.01f"check_lantern");
}

void check_lantern(string &in asTimer)
{
    if(
GetLanternActive())
            {
            
//do stuff
            
            

    
AddTimer("tmr_check"0.01f"check_lantern");

Try this. This is a timer which is looped unless the lantern is on, once its on you can put anything you want to happen in there. If you want to remove the timer after the first time player lits the lantern, add
PHP Code: (Select All)
RemoveTimer("tmr_check");
return; 
these into your getlanternactive func
(This post was last modified: 05-27-2016, 05:03 PM by Slanderous.)
05-27-2016, 05:03 PM
Find


Messages In This Thread
RE: Display message when player tries to use lantern - by Slanderous - 05-27-2016, 05:03 PM



Users browsing this thread: 1 Guest(s)