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
Trigger script when using any laudanum
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#11
RE: Trigger script when using any laudanum

PHP Code: (Select All)
void HPCheck(string &in t)
{
    if(
GetPlayerHealth()-5.0f GetLocalVarFloat("PlayerLastHP"))
    {
        
PlayerUsedPotion();
    }
    else if(
GetPlayerHealth() > 95)
    {
        
PlayerUsedPotion();
    }
    else
    {
        
SetLocalVarFloat("PlayerLastHP"GetPlayerHealth());
        
AddTimer(t0.0166f"HPCheck");
    }


Like this?

(I also put the end of the script in it's own "else" bracket so that the timer stops repeating if one of the conditions is satisfied.)

06-07-2012, 08:38 AM
Find


Messages In This Thread
RE: Trigger script when using any laudanum - by Damascus - 06-07-2012, 08:38 AM



Users browsing this thread: 1 Guest(s)