# # author: Zughy featured in: mc.trickerytown.com # # HOW DOES IT WORK # This script allows you to implement a "give to player" objective in BetonQuest. You just need to right click any player in the server! # # WHAT YOU NEED # 1 - create a folder inside the BetonQuest's and rename it "ADDON" # 2 - in that folder create a package named Denizen (BEWARE: you can rename these 2 folders as you like, just remember to change also the code below) # 3 - to start the objective, you must run the command I put in the last few lines of code. I usually run it via another event where I give the items the player needs to distribute. # So yeah, this WON'T give the quest item, you have to add a "^give " inside the event # 4 - the item you want to distribute must have a "#" in the last line of the lore # 5 - inside the "Denizen" package, you must create an event called "TALK", which will be triggered when the player gives away all the quest items # talk_event_handler: type: world events: on player right clicks at player: - if ! && "" { - run talk_event def:|| instantly } talk_event: type: task definitions: pl|clicked_pl|lore script: # if the last line doesn't contain any colour, change substring[12] with substring[8] # else if it contains a colour AND a format like italic, bold etc., change substring[12] with substring[16] - define qID '' # # if the clicked player is new # - if - if ]>]> && !].as_list.contains[]> { - flag talk:->: - flag talk[1]:-:1 - take iteminhand quantity:1 - give quantity:1 player: - narrate "<&a>Received from " targets: # # if it was the last player to click on, trigger the event # - if ].get[1]> == 0 { - narrate "<&a>Completed!" targets: # in case you want to rename the 2 folders and/or change the path, just edit here - execute as_server "q e ADDON-Denizen.TALK" - flag talk:! # # or tell the player how many are left # } else { - narrate "<&a>Item delivered! ].get[1].round_down> players left" targets: } # # if they've clicked that player already # } else { - narrate "<&c>You've already given the item to this player" targets: } talk_command: type: command name: dtalk permission: denizen.bypass script: # # /dtalk # i.e: "/dtalk Zughy 15 5" will start the objective for Zughy, requiring an item having "#15" in the description and 5 players to deliver that item # - flag talk: