-rtd_gui_task: - type: task - debug: false - speed: 0 - prefix: '&ss1&ss2&ss1&ss5&ss2&ss0&ss2&ss0&ss0&ss5&ss1&ss8&ss2&ss5&ss0&ss7&ss2&ss1&ss0&ss9&ssr' - script: - - define base_inv '' - #- define base_inv 'in@generic[title=<&6><&l>Lottery GUI;size=27;contents=li@i@air]' - - inventory open 'd:in@generic[title=<&6><&l>Lottery GUI;size=27]' - - wait 1t - - repeat 50 { - - define rng '' - - if < 30 { - - define item 'i@iron_sword[display_name=&sseLottery Sword;lore=&ss6Whippity whoopity, you now have a sword!;enchantments=DURABILITY,2|DAMAGE_ALL,3]' - } - else if < 40 { + - if : + - determine cancelled passively + - stop if: + - flag vin_cd2 expire:1s + - define radius 1 + - define add 1 + - define pointvalue 20 + - define start + - define points <[start].points_around_y[radius=<[radius]>;points=<[pointvalue]>]> + - foreach <[points]> as:point: + - playeffect effect:dust_color_transition at:<[point]> special_data:1|<&color[#ffa6f9]>|<&color[#cce2ff]> quantity:1 offset:0 visibility:100 + - define victim <[start].points_around_y[radius=<[radius]>;points=<[pointvalue].find_entities.within[1]>]> + - hurt <[victim]> + - define add:+:0.1 + - define radius:+:<[add]> + - define pointvalue:+:20 - - define item 'i@largetoken' - } - else if < 60 { - - define item 'i@diamond_chestplate[display_name=&ssaLottery Chestplate;nbt_attributes=generic.armor/chest/0/1]' - } - else if < 85 { - - define item 'i@lootpot' - } - else if < 110 { - - define item 'i@FartPotion' - } - else if < 140 { - - define item 'i@lifegem' - } - else if < 145 { - - define item 'i@relic' - } - else if < 165 { - - define item 'i@smalltoken' - } - else if < 175 { - - define item 'i@mediumtoken' - } - else if < 190 { - - define item 'i@dirt[display_name=<&6>Dertt :c]' - } - # 15% chance - else { - - define item 'i@LuckyTag' - } - - if != { - - inventory open - 'd:in@generic[title=<&6><&l>Lottery GUI;size=27;contents=li@i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|i@air|]' - } - - define prev_item '' - - wait ].round_up>t - } - - wait 1s - - narrate "<&6>[<&b>Lottery<&6>] <&e>Congratulations! You got !" - - give - - flag player can_close_inv - - inventory close - -rtd_gui_evts: - type: world - debug: false - events: - on player closes inventory: - - if { - - if ! { - - determine cancelled - } - - flag player can_close_inv:! - }