Jump to content
  • 0

2 different menu options


Yuna

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

Im trying to make this npc give out 2 different menu options depending on if you carry a certain item.

 

for example:

 

by default the menu is offering (option 1:option 2:option 3)

 

but if you have an apple for example in your inventory the menus options would change to  (option 4:option 5:option 6)

 

Not sure how to do it, the ways i tried out didn't work, hoping somebody is able to help :)

 

Thank you!

Edited by Lilo
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  


if ( countitem( 512 ) ) {

menu "Option 1",opt1,"Option 2",opt2,"Option 3",opt3;

}

else {

menu "Option 4",opt4,"Option 5",opt5,"Option 6",opt6;

}

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

something like...


	select( 
		( countitem( 512 ) <= 0 ) ? "Option 1":"",
		( countitem( 512 ) <= 0 ) ? "Option 2":"",
		( countitem( 512 ) <= 0 ) ? "Option 3":"",
		( countitem( 512 ) >= 1 ) ? "Option 4":"",
		( countitem( 512 ) >= 1 ) ? "Option 5":"",
		( countitem( 512 ) >= 1 ) ? "Option 6":""
	);
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

the menu I have is:

menu "Option 1",opt1,
"Option 2",opt2,
"Option 3",opt3;

with an apple it should be

 

menu "Option 4",opt4,
"Option 5",opt5,
"Option 6",opt6;
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

 

the menu I have is:

menu "Option 1",opt1,
"Option 2",opt2,
"Option 3",opt3;

with an apple it should be

 

menu "Option 4",opt4,
"Option 5",opt5,
"Option 6",opt6;

Did you try Emistry's solution? It already looks like it will suit your needs.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

 

 

the menu I have is:

menu "Option 1",opt1,
"Option 2",opt2,
"Option 3",opt3;

with an apple it should be

 

menu "Option 4",opt4,
"Option 5",opt5,
"Option 6",opt6;

Did you try Emistry's solution? It already looks like it will suit your needs.

 

 

 

I did (it errored)

also, my menu is different, it's using menu instead of select.

 

How would I do what emistry suggested with a menu like what I post is what I'm asking.

Edited by Lilo
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...