#reformatted the flag to use a flag map instead, can read more about that here: https://guide.denizenscript.com/guides/basics/flags.html#advanced-note-maps-and-sub-maps #night market inventory night_market: type: inventory inventory: chest size: 27 #set gui to true so you don't have to listen to click events and cancel them manually gui: true #filler item definitions: filler: black_stained_glass_pane[display=<&r>] #procedural items for the unrevealed/revealed items ##can read more about them here https://meta.denizenscript.com/Docs/Languages/inventory%20script%20containers procedural items: #define the contents #https://meta.denizenscript.com/Docs/Tags/repeat_as#objecttag.repeat_as_list - define contents ]> #define the reroll item depending if they've rerolled or not - if : - define reroll "barrier[display=<&c>You've already rerolled...]" - else: - define reroll reroll_item #determine the defined contents + the reroll - determine <[contents].include[<[reroll]>]> slots: - [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] - [filler] [] [filler] [] [filler] [] [filler] [] [filler] - [] [filler] [filler] [filler] [filler] [filler] [filler] [filler] [filler] #item that appears if they haven't "revealed" the item in that slot yet (can modify to your likings) unrevealed_item: type: item material: gold_nugget display name: <&a>Click to reveal... #rerolling item reroll_item: type: item material: ender_eye display name: <&a>Click to re-roll... night_market_handler: type: world events: after player clicks unrevealed_item in night_market: #a random item from a list as loot - define loot - inventory set slot: d: o:<[loot]> #these are the items (revealed and unrevealed) that you determine as procedural items above #the slot numbers are the slots in which there are items to reveal/revealed already #there are multiple ways of doing this (matchers and what not), I think this works for an example - define contents - flag night_market.contents:<[contents]> after player clicks reroll_item in night_market: #define the already rolled items - define rolls ]> #check if they've rolled all items before they reroll #https://meta.denizenscript.com/Docs/Tags/contains_mat#listtag.contains_match #https://meta.denizenscript.com/Docs/Search/fallbacks#tag%20fallbacks ##this is optional, I just thought it'd make sense to have a check for it - if <[rolls].contains_match[unrevealed_item]> || !<[rolls].is_truthy>: - narrate "<&c>Roll every item first!" - stop #remove the previously saved contents - flag night_market.contents:! #flag the player to track if they've rerolled or not - flag night_market.rerolled #reopen the inventory - inventory open d:night_market #this is where you reset every players night market #in this example, this will only run at 12pm every Sunday after system time 12:00: #check if day is Sunday - if != sunday: - stop - announce "<&a>Night Market <&7>has been reset!" #remove the night_market flag from every player that has it #https://meta.denizenscript.com/Docs/Tags/server.players_flagged#server.players_flagged - flag night_market:!