Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #on inventory click:
- #set {_a} to event-item's name
- #send "%{_a}%"
- #ガチャ設定アイテム
- #
- on load:
- set {gatya.k} to diamond named "&e&l景品設定"
- set {gatya.n} to name tag named "&e&lガチャの名前変更"
- set {gatya.s} to writable book named "&e&lガチャの詳細設定"
- set {gatya.i} to chest named "&e&lガチャアイテム変更"
- set {gatya.r} to emerald named "&e&lレアリティ設定"
- set {gatya.n.%player%} to false
- set {gatya.R.N.%player%::status} to false
- command /gatya <text>:
- permission: op
- trigger:
- if arg 1 is "list":
- set {_gatya} to chest with 6 row named "&6&lガチャ一覧"
- loop {gatya.list::*}:
- set slot loop-index parsed as number - 1 of {_gatya} to chest named "%loop-value%"
- open {_gatya} to player
- else if arg 1 is "create":
- if {gatya.list::*} is not set:
- add "&6&lガチャ1" to {gatya.list::*}
- set {_size} to 1
- set {gatya.rarity::%{_size}%::0} to 1
- loop 9 time:
- set {gatya.rarity::%{_size}%::%loop-number%} to "&f&lレアリティ%loop-number%"
- set {gatya.rarity.chance::%{_size}%::%loop-number%} to 1
- else:
- set {_size} to size of {gatya.list::*}
- set {_size} to {_size} + 1
- add "&6&lガチャ%{_size}%" to {gatya.list::*}
- set {gatya.rarity::%{_size}%::0} to 1
- loop 9 times:
- set {gatya.rarity::%{_size}%::%loop-number%} to "&f&lレアリティ%loop-number%"
- set {gatya.rarity.chance::%{_size}%::%loop-number%} to 1
- else if arg 1 is "reset":
- delete {gatya.list::*}
- delete {gatya.rarity::*}
- else:
- send "&cerror pleas [list] or [create]"
- on chat:
- if {gatya.R.C.%player%::status} is true:
- cancel event
- set {_gatya.r.c} to message parsed as integer
- if parse error is set:
- send "&c数字のみ入力可能です。ガチャメニューより再試行してください"
- set {gatya.R.C.%player%::status} to false
- else:
- set {gatya.rarity.chance::%{gatya.setting.%player%}%::%{gatya.R.C.%player%::index}%} to {_gatya.r.c}
- send "&a&l%{gatya.rarity::%{gatya.setting.%player%}%::%{gatya.R.N.%player%::index}%}%の排出比率を&e&l%{_gatya.r.c}%&b&lに変更しました"
- set {gatya.R.C.%player%::status} to false
- if {gatya.R.N.%player%::status} is true:
- cancel event
- set {_gatya.r.n} to the chat message
- set {_index} to {gatya.R.N.%player%::index}
- set {gatya.rarity::%{gatya.setting.%player%}%::%{_index}%} to "%{_gatya.r.n}%"
- send "&b&lレアリティの名前を%{_gatya.r.n}%&b&lに変更しました"
- set {gatya.R.N.%player%::status} to false
- if {gatya.n.%player%} is true:
- cancel event
- set {_gatya.c} to the chat message
- set {_size} to size of {gatya.list::*}
- loop {gatya.list::*}:
- set {_l} to loop-index parsed as number
- if {_gatya.c} is {gatya.list::%{_l}%}:
- send "&c同名のガチャがあります!別の名前で再試行してください"
- set {gatya.n.%player%} to false
- stop
- else if {_size} is {_l}:
- set {gatya.list::%{gatya.setting.%player%}%} to "%{_gatya.c}%"
- set {gatya.n.%player%} to false
- send "ガチャの名前を%{_gatya.c}%&fに変更しました"
- on inventory click:
- if name of player's current inventory contain "&6&lガチャ一覧":
- cancel event
- if event-item is chest:
- set {_n} to event-item's name
- loop {gatya.list::*}:
- set {_l} to loop-index
- if {gatya.list::%{_l}%} is {_n}:
- set {gatya.setting.%player%} to {_l}
- open chest with 1 row named "&6&lガチャ設定&f[%{_n}%&f]" to player
- set slot 0 of player's current inventory to {gatya.k}
- set slot 1 of player's current inventory to {gatya.n}
- set slot 2 of player's current inventory to {gatya.i}
- set slot 3 of player's current inventory to {gatya.r}
- if name of player's current inventory contain "&6&lガチャ景品設定[レアリティ選択]":
- cancel event
- set {gatya.item.%player%} to event-slot's index + 1
- set {_gatya} to chest with 6 row named "&6&l景品設定[%{gatya.rarity::%{gatya.setting.%player%}%::%{gatya.item.%player%}%}%]"
- loop {gatya.item::%{gatya.setting.%player%}%::%{gatya.item.%player%}%::*}:
- set slot loop-index parsed as number - 1 of {_gatya} to loop-value
- open {_gatya} to player
- if event-item is {gatya.k}:
- cancel event
- open chest with 1 row named "&6&lガチャ景品設定[レアリティ選択]" to player
- loop 9 time:
- if {gatya.rarity::%{gatya.setting.%player%}%::0} >= loop-number:
- set slot loop-number - 1 of player's current inventory to chest named "%{gatya.rarity::%{gatya.setting.%player%}%::%loop-number%}%" with lore "&a有効"
- else if {gatya.rarity::%{gatya.setting.%player%}%::0} < loop-number:
- set slot loop-number - 1 of player's current inventory to ender chest named "%{gatya.rarity::%{gatya.setting.%player%}%::%loop-number%}%" with lore "&c無効" and "&f景品設定はできますがガチャからは排出されません"
- # set {_gatya} to chest with 6 row named "&6&lガチャ景品設定"
- # loop {gatya.item::%{gatya.setting.%player%}%::*}:
- # set slot loop-index parsed as number - 1 of {_gatya} to loop-value
- # open {_gatya} to player
- if event-item is {gatya.n}:
- cancel event
- set {gatya.n.%player%} to true
- send "&a&lガチャの名前を入力してください"
- send "&l現在:[%{gatya.list::%{gatya.setting.%player%}%}%&f]"
- close event-player's inventory
- if event-item is {gatya.i}:
- cancel event
- #open chest with 1 row named "&6&lガチャアイテム" to player
- give chest named "%{gatya.list::%{gatya.setting.%player%}%}%" with lore "&f右クリックで開封" to player
- if event-item is {gatya.r}:
- cancel event
- open chest with 5 row named "&6&lガチャレアリティ設定" to player
- set {_chance} to paper named "&f全体比率"
- set {_chance2} to paper named "&f有効比率"
- loop 9 time:
- add {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%} to {_all}
- if {gatya.rarity::%{gatya.setting.%player%}%::0} >= loop-number:
- add {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%} to {_all2}
- add "&f合計比率:&a%{_all}%" to lore of {_chance}
- add "&f合計比率:&a%{_all2}%" to lore of {_chance2}
- loop 9 time:
- set {_name} to {gatya.rarity::%{gatya.setting.%player%}%::%loop-number%}
- set {_size} to {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}
- set {_percent} to {_size} / {_all} * 100
- set {_percent2} to {_size} / {_all2} * 100
- set slot loop-number + 26 of player's current inventory to name tag named "&f名前の変更" with lore "&f現在%{_name}%"
- if {gatya.rarity::%{gatya.setting.%player%}%::0} >= loop-number:
- set slot loop-number + 17 of player's current inventory to chest named "%{_name}%" with lore "&a有効"
- set slot loop-number + 8 of player's current inventory to yellow stained glass pane named "&f比率変更" with lore "&f現在:&e%{gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}%"
- add "%{_name}%:&e%{_size}%,(%{_percent}%%%)" to lore of {_chance}
- add "%{_name}%:&e%{_size}%,(%{_percent2}%%%)" to lore of {_chance2}
- else if {gatya.rarity::%{gatya.setting.%player%}%::0} < loop-number:
- set slot loop-number + 17 of player's current inventory to ender chest named "%{_name}%" with lore "&c無効" and "&fクリックで有効化"
- set slot loop-number + 8 of player's current inventory to red stained glass pane named "&f比率変更" with lore "&f現在:&e%{gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}%" and "&c無効 変更は可能ですが排出対象にはなりません"
- add "%{_name}%:&c%{_size}%,(%{_percent}%%%)" to lore of {_chance}
- set slot 0 of player's current inventory to {_chance}
- set slot 1 of player's current inventory to {_chance2}
- if name of player's current inventory contain "&6&lガチャレアリティ設定":
- cancel event
- if event-item is name tag:
- set {gatya.R.N.%player%::status} to true
- set {gatya.R.N.%player%::index} to event-slot's index - 26
- send "&a&lレアリティの名前を入力してください"
- send "&l現在:[%{gatya.rarity::%{gatya.setting.%player%}%::%{gatya.R.N.%player%::index}%}%&f&l]"
- close event-player's inventory
- if event-item is yellow stained glass pane or red stained glass pane:
- set {gatya.R.C.%player%::status} to true
- set {gatya.R.C.%player%::index} to event-slot's index - 8
- send "&a&l%{gatya.rarity::%{gatya.setting.%player%}%::%{gatya.R.N.%player%::index}%}%の排出比率を入力してください"
- send "&l現在:[%{gatya.rarity.chance::%{gatya.setting.%player%}%::%{gatya.R.C.%player%::index}%}%&f&l]"
- send "&c※数字が大きいほど排出されやすくなります"
- close event-player's inventory
- if event-item is chest or ender chest:
- set {_slot} to event-slot's index - 17
- set {gatya.rarity::%{gatya.setting.%player%}%::0} to {_slot}
- set {_chance} to paper named "&f全体比率"
- set {_chance2} to paper named "&f有効比率2"
- loop 9 time:
- add {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%} to {_all}
- if {gatya.rarity::%{gatya.setting.%player%}%::0} >= loop-number:
- add {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%} to {_all2}
- add "&f合計比率:&a%{_all}%" to lore of {_chance}
- add "&f合計比率:&a%{_all2}%" to lore of {_chance2}
- loop 9 time:
- set {_name} to {gatya.rarity::%{gatya.setting.%player%}%::%loop-number%}
- set {_size} to {gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}
- set {_percent} to {_size} / {_all} * 100
- set {_percent2} to {_size} / {_all2} * 100
- set slot loop-number + 26 of player's current inventory to name tag named "&f名前の変更"
- if {gatya.rarity::%{gatya.setting.%player%}%::0} >= loop-number:
- set slot loop-number + 17 of player's current inventory to chest named "%{_name}%" with lore "&a有効"
- set slot loop-number + 8 of player's current inventory to yellow stained glass pane named "&f比率変更" with lore "&f現在:&e%{gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}%"
- add "%{_name}%:&e%{_size}%,(%{_percent}%%%)" to lore of {_chance}
- add "%{_name}%:&e%{_size}%,(%{_percent2}%%%)" to lore of {_chance2}
- else if {gatya.rarity::%{gatya.setting.%player%}%::0} < loop-number:
- set slot loop-number + 17 of player's current inventory to ender chest named "%{_name}%" with lore "&c無効" and "&fクリックで有効化"
- set slot loop-number + 8 of player's current inventory to red stained glass pane named "&f比率変更" with lore "&f現在:&e%{gatya.rarity.chance::%{gatya.setting.%player%}%::%loop-number%}%" and "&a無効 変更は可能ですが排出対象にはなりません"
- add "%{_name}%:&c%{_size}%,(%{_percent}%%%)" to lore of {_chance}
- set slot 0 of player's current inventory to {_chance}
- set slot 1 of player's current inventory to {_chance2}
- if name of player's current inventory contain "&6&lガチャ景品一覧":
- if event-item is chest:
- cancel event
- set {gatya.view.%player%} to event-slot's index + 1
- set {_gatya} to chest with 6 row named "&6&l[%{gatya.rarity::%{gatya.using.%player%}%::%{gatya.view.%player%}%}%&6&l]景品一覧"
- loop {gatya.item::%{gatya.using.%player%}%::%{gatya.view.%player%}%::*}:
- set slot loop-index parsed as number - 1 of {_gatya} to loop-value
- open {_gatya} to player
- on inventory close:
- if name of event-inventory is "&6&l景品設定[%{gatya.rarity::%{gatya.setting.%player%}%::%{gatya.item.%player%}%}%]":
- set {_n} to {gatya.setting.%player%}
- set {_gatyanum} to 1
- #set {gatya-num} to 0
- delete {gatya.item::%{gatya.setting.%player%}%::%{gatya.item.%player%}%::*}
- loop 54 times:
- set {gatya.item::%{_n}%::%{gatya.item.%player%}%::%{_gatyanum}%} to slot loop-number - 1 of event-inventory
- if {gatya.item::%{_n}%::%{gatya.item.%player%}%::%{_gatyanum}%} is not air:
- add 1 to {_gatyanum}
- #add 1 to {gatya-num}
- else if {gatya.item::%{_n}%::%{gatya.item.%player%}%::%{_gatyanum}%} is air:
- delete {gatya.item::%{_n}%::%{gatya.item.%player%}%::%{_gatyanum}%}
- on left click:
- if player's tool is chest:
- set {_n} to event-item's name
- loop {gatya.list::*}:
- set {_l} to loop-index
- if {gatya.list::%{_l}%} is {_n}:
- set {gatya.using.%player%} to loop-index parsed as number
- open chest with 1 row named "&6&lガチャ景品一覧" to player
- loop 9 time:
- if {gatya.rarity::%{gatya.using.%player%}%::0} >= loop-number:
- add {gatya.rarity.chance::%{gatya.using.%player%}%::%loop-number%} to {_all2}
- loop 9 time:
- set {_size} to {gatya.rarity.chance::%{gatya.using.%player%}%::%loop-number%}
- set {_percent2} to {_size} / {_all2} * 100
- if {gatya.rarity::%{gatya.using.%player%}%::0} >= loop-number:
- set slot loop-number - 1 of player's current inventory to chest named "%{gatya.rarity::%{gatya.using.%player%}%::%loop-number%}%" with lore "&e&l排出確率:%{_percent2}%%%"
- on right click:
- if player's tool is chest:
- set {_n} to event-item's name
- loop {gatya.list::*}:
- set {_l} to loop-index
- if {gatya.list::%{_l}%} is {_n}:
- send "%{_n}%"
- remove 1 of event-item from player
- play sound "entity.experience_orb.pickup" with volume 0.5 to the player
- loop 9 time:
- if {gatya.rarity::%{_l}%::0} >= loop-number:
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_all}
- set {_r} to random integer between 1 and {_all}
- loop 9 time:
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p1} if 1 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p2} if 2 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p3} if 3 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p4} if 4 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p5} if 5 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p6} if 6 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p7} if 7 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p8} if 8 >= loop-number
- add {gatya.rarity.chance::%{_l}%::%loop-number%} to {_p9} if 9 >= loop-number
- if {_r} <= {_p1}:
- set {_size} to size of {gatya.item::%{_l}%::1::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::1::%{_r2}%} to player
- send "%{gatya.rarity::%{_l}%::1}%" to player
- else if {_r} <= {_p2}:
- send "%{gatya.rarity::%{_l}%::2}%" to player
- set {_size} to size of {gatya.item::%{_l}%::2::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::2::%{_r2}%} to player
- else if {_r} <= {_p3}:
- send "%{gatya.rarity::%{_l}%::3}%" to player
- set {_size} to size of {gatya.item::%{_l}%::3::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::3::%{_r2}%} to player
- else if {_r} <= {_p4}:
- send "%{gatya.rarity::%{_l}%::4}%" to player
- set {_size} to size of {gatya.item::%{_l}%::4::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::4::%{_r2}%} to player
- else if {_r} <= {_p5}:
- send "%{gatya.rarity::%{_l}%::5}%" to player
- set {_size} to size of {gatya.item::%{_l}%::5::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::5::%{_r2}%} to player
- else if {_r} <= {_p6}:
- send "%{gatya.rarity::%{_l}%::6}%" to player
- set {_size} to size of {gatya.item::%{_l}%::6::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::6::%{_r2}%} to player
- else if {_r} <= {_p7}:
- send "%{gatya.rarity::%{_l}%::7}%" to player
- set {_size} to size of {gatya.item::%{_l}%::7::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::7::%{_r2}%} to player
- else if {_r} <= {_p8}:
- send "%{gatya.rarity::%{_l}%::8}%" to player
- set {_size} to size of {gatya.item::%{_l}%::8::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::8::%{_r2}%} to player
- else if {_r} <= {_p9}:
- send "%{gatya.rarity::%{_l}%::9}%" to player
- set {_size} to size of {gatya.item::%{_l}%::9::*}
- set {_r2} to random integer between 1 and {_size}
- give {gatya.item::%{_l}%::9::%{_r2}%} to player
- on click:
- if player's tool is stone:
- set {_i} to event-items's name
- send "%{gatya.list::%{_i}%}%"
- if player's tool is stick:
- send "&b%{gatya.list::*}%"
- send "&c{gatya.setting.%player%}:%{gatya.setting.%player%}%"
- if player's tool is iron ingot:
- loop 54 time:
- send "&c{gatya.item::%{gatya.setting.%player%}%::%{gatya.item.%player%}%::*}:%{gatya.item::%{gatya.setting.%player%}%::%{gatya.item.%player%}%::%loop-number%}%"
- if player's tool is golden sword:
- make player execute command "/gatya list"
Advertisement
Add Comment
Please, Sign In to add comment