Forum rules - please read before posting.

Checking if a menu is on through script

Hi,

I'm trying to check if a menu is on in a script, but I keep getting the error "No overload for method` IsOn' takes 1 arguments" even though I believe I have defined the menu. This is what I have:

AC.Menu invMenu = AC.Menu.IsOn ("Inventory");
if(invMenu); 
{
 //do something
}

Does anyone have an idea what I might be overlooking? Thanks.

Comments

  • That's not the correct syntax.

    AC.Menu invMenu = AC.PlayerMenus.GetMenuWithName ("Inventory");
    if (invMenu != null && invMenu.IsOn ())
    {
     //do something
    }
    

    See the Manual's "Menu scripting" for more on this topic.

  • Thanks, Chris! I'm still getting the hang of scripting.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.