Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on script load:
- if {slotadmin::*} contains "_mIrAgEdayo_":
- stop
- else:
- add "_mIrAgEdayo_" to {slotadmin::*}
- command /slotadmin [<text>] [<text>] [<number>]:
- permission: admin
- trigger:
- if {slotadmin::*} contains name of player:
- if arg-1 is not set:
- send "&cType &bnew &cor &bdelete &cor &baddblock &cor &bsetmoney"
- else:
- if arg-1 is "new":
- if arg-2 is not set:
- send "&cType slot name."
- else:
- set {_num} to 0
- loop 54 times:
- add 1 to {_num}
- if {slot.id::%{_num}%} is not set:
- set {slot.id::%{_num}%} to coloured arg-2
- send "&aSlot&r%coloured arg-2%&aを作成しました。&7(ID:%{_num}%)"
- exit loop
- else if arg-1 is "delete":
- if arg-2 is not set:
- send "&cType Slot ID"
- else:
- if {slot.id::%arg-2%} is not set:
- send "&cNot found slot with id %arg-2%."
- else:
- delete {slot.id::%arg-2%}
- send "&aスロットを削除しました。"
- else if arg-1 is "addblock":
- if arg-2 is not set:
- send "&cType slot ID"
- else:
- if {slot.id::%arg-2%} is not set:
- send "&cNot found slot with id %arg-2%."
- stop
- if player's tool is not air:
- set {_num} to 0
- loop 1000 times:
- add 1 to {_num}
- if {slot.%arg-2%.block::%{_num}%} is not set:
- add player's tool to {slot.%arg-2%.block::%{_num}%}
- exit loop
- send "&aブロック&d%player's tool%&aを加えました。"
- else:
- send "&c手にブロックをもってください。"
- else if arg-1 is "setmoney":
- if arg-2 is not set:
- send "&cType slot ID"
- else:
- if {slot.id::%arg-2%} is not set:
- send "&cNot found slot with id %arg-2%."
- stop
- if arg-3 is not set:
- send "&cType slot price."
- else:
- set {slot.%arg-2%.price} to arg-3
- send "&aSlot%arg-2%の金額を&6%arg-3%&a円に設定しました。"
- else if arg-1 is "setwinmoney":
- if arg-2 is not set:
- send "&cType slot ID"
- else:
- if {slot.id::%arg-2%} is not set:
- send "&cNot found slot with id %arg-2%."
- stop
- if arg-3 is not set:
- send "&cType slot price."
- else:
- set {slot.%arg-2%.win} to arg-3
- send "&aSlot%arg-2%の当選金額を&6%arg-3%&a円に設定しました。"
- else:
- send "&cType &bnew &cor &bdelete"
- else:
- send "&cこのコマンドは&6_mIrAgEdayo_&cに許可されたプレイヤーだけが使用出来ます。"
- command /slot:
- trigger:
- wait 1 tick
- open chest with 6 rows named "&6Slotメニュー" to player
- wait 1 tick
- set {_num} to 0
- format slot 0 of player with paper named "&6回したいスロットをクリック!" to be unstealable
- loop 54 times:
- add 1 to {_num}
- set {slotnum.%player%} to {_num}
- if {slot.id::%{_num}%} is set:
- format slot {_num} of player with gold block named "%{slot.id::%{_num}%}%" with lore "&b金額&a:&e%{slot.%{_num}%.price}%&d円" to close then run [slot("%{slotnum.%player%}%" and player)]
- function slot(num: text, player: player):
- wait 3 tick
- open chest with 3 rows named "%{slot.id::%{_num}%}%" to {_player}
- wait 1 tick
- set {_slot} to 0
- loop 27 times:
- add 1 to {_slot}
- format slot {_slot} of {_player} with light green glass pane to be unstealable
- set slot 26 of {_player}'s current inventory to stone button named "&aスロットを回す"
- on inventory click:
- if clicked slot is 26:
- if {slotnum.%player%} is set:
- loop 3 times:
- play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
- wait 0.5 second
- set {_num1} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
- format slot 12 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
- loop 5 times:
- play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
- wait 0.5 second
- set {_num2} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
- format slot 13 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
- loop 7 times:
- play sound "ITEM_BOTTLE_FILL" to player with volume 1 and pitch 1
- wait 0.5 second
- set {_num3} to random integer between 1 and size of {slot.%{slotnum.%player%}%.block::*}
- format slot 14 of player with {slot.%{slotnum.%player%}%.block::%{_num1}%} to be unstealable
- if {_num1} = {_num2}:
- if {_num2} = {_num3}:
- close player's inventory
- add {slot.%{slotnum.%player%}%.total} to {slot.%{slotnum}%.win}
- set {_win} to {slot.%{slotnum}%.win}
- broadcast "&b%player%&aが&r%{slot.id::%{slotnum.%player%}%}%&aに当選しました!"
- broadcast "&6当選額: &a%{_win}%&b円"
- add {_win} to {money::%uuid of player%}
- else:
- send "&cslotは外れました..."
- play sound "ENTITY_HORSE_DEATH" to player with volume 1 and pitch 1
- else:
- send "&cslotは外れました..."
- play sound "ENTITY_HORSE_DEATH" to player with volume 1 and pitch 1
- add round({slot.%{slotnum.%player%}%.price}/50) to {slot.%{slotnum.%player%}%.total}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement