Page 1 of 1

Clickable Yes/No?

Posted: November 7th, 2019, 12:29 pm
by MrFF
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
*click no*

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

Re: Clickable Yes/No?

Posted: November 7th, 2019, 4:41 pm
by mcmonkey
- 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.

Re: Clickable Yes/No?

Posted: November 7th, 2019, 5:22 pm
by MrFF
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]"

Re: Clickable Yes/No?

Posted: November 8th, 2019, 2:52 pm
by mcmonkey
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.