Clickable Yes/No?

MrFF

Member
Nov 5, 2019
5
0
0
Hi guys! I see clickable yes/no functions all the time, what's the best way to make this function?

For example:
-click NPC
-Npc says "blah blah blah"
-narrator says "click yes or No"
"Yes" "No"

*hit T (or whatever your chat key is)*
*mouse over "yes"*
*click it*
-rest of script runs
or
*click no*
-stop

Alternatively:
-narrator says "click Yes or No"
*click yes or no*
 

mcmonkey

Administrator
Staff member
Helper
- narrate "Click <element[yes].on_click[yes].type[run_command].on_hover[Click to say yes]>"
Then a chat trigger listening for "yes"
Alternately a command script and similar overall concept.
 

MrFF

Member
Nov 5, 2019
5
0
0
Ahh nice, this is so much more simple than Minecraft's default tellraw command, but similar style! I love it! Thanks a ton!

Also, how could you change from running a command to say, zapping to a different step in the script? instead of run_command maybe "flag"? could that work? is there a list of things you can put there? there's so many lists of different commands, and I'm not sure what applies to what

Ahh, nevermind, I understand, it would be prefferable if you could just zap right from the command type though.(Eg ".on_click[2].type[zap]"
 

mcmonkey

Administrator
Staff member
Helper
That's not quite possible, as the click is executed on the clientside - you have to write a script that reads whatever the client sends through and executes it as-needed on the server (a chat trigger or command script) - while also bearing in mind that players can send any chat/command they want at any time, so you have to make sure it's only situationally proper input.