Clickable Yes/No?

Discuss any issues with Denizen-Bukkit scripts or functionality you may have while using it.
Post Reply
MrFF
New
New
Posts: 5
Joined: November 5th, 2019, 8:42 am

Clickable Yes/No?

Post by MrFF » November 7th, 2019, 12:29 pm

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*

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 236
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Clickable Yes/No?

Post by mcmonkey » November 7th, 2019, 4:41 pm

- 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.
Denizen lead developer.
http://mcmonkey.org

MrFF
New
New
Posts: 5
Joined: November 5th, 2019, 8:42 am

Re: Clickable Yes/No?

Post by MrFF » November 7th, 2019, 5:22 pm

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]"

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 236
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Clickable Yes/No?

Post by mcmonkey » November 8th, 2019, 2:52 pm

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.
Denizen lead developer.
http://mcmonkey.org

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest