Jump to content

Photo

How do I properly make ifHookShotIsUsedHealLink Script please?


  • Please log in to reply
1 reply to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 29 April 2018 - 04:40 AM

Is

global script ifHookShotIsUsedHealLink
{
  void run()
  {
    if ( Link-> LWeapon[Hookshot (Long)] = true)
    {
      if ( Link->InputB )
      {
        if ( Link->HP != Link->Maximum_HP )
        {
          Link->Increment[HP] += 1;
        }
      }
    }
  }
}

a workable code to get it to where if Link uses Hookshot (Long) as B weapon Link's HP will get increased by 1 until His HP is equal to His Maximum HP or no?

 

 

 

If no then how do I fix up above code [code please thank you]?

 

 

 

Thank you all for your help in advance ;)



#2 Saffith

Saffith

    IPv7 user

  • Members

Posted 29 April 2018 - 09:33 AM

There isn't really a good way to do it as a global script. Even if the hookshot is equipped, pressing B doesn't always use it. Maybe it's already firing, or maybe Link's in the water. You could watch for the hookshot lweapon to appear, but if Link's too close to a wall, it won't.

 

Best thing to do is make it an item script, which is very simple:

item script HealingHookshot
{
    void run()
    {
        Link->HP=Min(Link->HP+1, Link->MaxHP);
    }
}

It could also check if(Link->HP<Link->MaxHP) instead of using Min(), but Min() will work better if you change it to restore more than 1 HP at a time.


  • LikeLike888 likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users