Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RollLottery(P:player):
- set {_RollItem} to slot 40 of {_P}'s current inventory
- set slot 40 of {_P}'s current inventory to slot 41 of {_P}'s current inventory
- set slot 41 of {_P}'s current inventory to slot 42 of {_P}'s current inventory
- set slot 42 of {_P}'s current inventory to slot 43 of {_P}'s current inventory
- set slot 43 of {_P}'s current inventory to slot 34 of {_P}'s current inventory
- set slot 34 of {_P}'s current inventory to slot 25 of {_P}'s current inventory
- set slot 25 of {_P}'s current inventory to slot 16 of {_P}'s current inventory
- set slot 16 of {_P}'s current inventory to slot 15 of {_P}'s current inventory
- set slot 15 of {_P}'s current inventory to slot 14 of {_P}'s current inventory
- set slot 14 of {_P}'s current inventory to slot 13 of {_P}'s current inventory
- set slot 13 of {_P}'s current inventory to slot 12 of {_P}'s current inventory
- set slot 12 of {_P}'s current inventory to slot 11 of {_P}'s current inventory
- set slot 11 of {_P}'s current inventory to slot 10 of {_P}'s current inventory
- set slot 10 of {_P}'s current inventory to slot 19 of {_P}'s current inventory
- set slot 19 of {_P}'s current inventory to slot 28 of {_P}'s current inventory
- set slot 28 of {_P}'s current inventory to slot 37 of {_P}'s current inventory
- set slot 37 of {_P}'s current inventory to slot 38 of {_P}'s current inventory
- set slot 38 of {_P}'s current inventory to slot 39 of {_P}'s current inventory
- set slot 39 of {_P}'s current inventory to {_RollItem}
- #==================================================================#
- function SetLotteryGui(P:player):
- set {_count} to 0
- loop 54 times:
- set slot {_count} of {_P}'s current inventory to black stained Glass Pane named "&0"
- add 1 to {_count}
- set slot 49 of {_P}'s current inventory to hopper named "&6抽獎"
- #==================================================================#
- set slot 10 of {_P}'s current inventory to air
- set slot 11 of {_P}'s current inventory to air
- set slot 12 of {_P}'s current inventory to air
- set slot 13 of {_P}'s current inventory to air
- set slot 14 of {_P}'s current inventory to air
- set slot 15 of {_P}'s current inventory to air
- set slot 16 of {_P}'s current inventory to air
- #==================================================================#
- set slot 19 of {_P}'s current inventory to air
- set slot 28 of {_P}'s current inventory to air
- #==================================================================#
- set slot 25 of {_P}'s current inventory to air
- set slot 34 of {_P}'s current inventory to air
- #==================================================================#
- set slot 37 of {_P}'s current inventory to air
- set slot 38 of {_P}'s current inventory to air
- set slot 39 of {_P}'s current inventory to air
- set slot 40 of {_P}'s current inventory to air
- set slot 41 of {_P}'s current inventory to air
- set slot 42 of {_P}'s current inventory to air
- set slot 43 of {_P}'s current inventory to air
- #==================================================================#
- on block break:
- if {%location of target block%.is.set} is true:
- delete {%location of target block%.is.set}
- set {_Save} to "%location of target block%" parsed as text
- set {_count} to 0
- loop 54 times:
- delete {%{_Save}%.獎品儲存.%{_count}%}
- add 1 to {_count}
- command /lottery [<text>] [<text>]:
- trigger:
- if arg-1 is "set":
- if target block is a chest:
- loop blocks in radius 4:
- loop-block is target block
- if {%location of target block%.is.set} is true:
- send "isset"
- else:
- send "set"
- set {%location of target block%.is.set} to true
- add location of target block to {Lottery_Box::*}
- else:
- send "noblock"
- if arg-1 is "clear":
- send "%{Lottery_Box::*}%"
- delete {Lottery_Box::*}
- send "%{Lottery_Box::*}%"
- if arg-1 is "edit":
- if target block is a chest:
- loop blocks in radius 4:
- loop-block is target block
- if {%location of target block%.is.set} is true:
- open chest with 6 rows named "&0設定獎品 %location of target block%" to player
- SetLotteryGui(player)
- set {_Save} to name of player's current inventory
- replace "&0設定獎品 " with "" in {_Save}
- set {_count} to 0
- loop 54 times:
- set slot {_count} of player's current inventory to {%{_Save}%.獎品儲存.%{_count}%}
- add 1 to {_count}
- on inventory click:
- name of player's current inventory contains "&0設定獎品":
- name of item is "&0" or "&6抽獎":
- cancel event
- on inventory close:
- name of player's current inventory contains "&0設定獎品":
- set {_Save} to name of player's current inventory
- replace "&0設定獎品 " with "" in {_Save}
- set {_count} to 0
- loop 54 times:
- set {%{_Save}%.獎品儲存.%{_count}%} to slot {_count} of player's current inventory
- add 1 to {_count}
- on right click on chest:
- if {%location of target block%.is.set} is true:
- cancel event
- open chest with 6 rows named "&0抽獎" to player
- SetLotteryGui(player)
- set {_Save} to "%location of target block%" parsed as text
- set {_count} to 0
- loop 54 times:
- set slot {_count} of player's current inventory to {%{_Save}%.獎品儲存.%{_count}%}
- add 1 to {_count}
- on inventory click:
- name of player's current inventory is "&0抽獎":
- cancel event
- if name of item contains "&6抽獎":
- player's money is larger than 2000
- remove 2000 from player's money
- set name of item to "&7抽獎機運作中..."
- set {抽獎中.%player%} to true
- loop 60 times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 1 tick
- loop 30 times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 2 tick
- loop 20 times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 3 tick
- set {_Roll} to a random integer between 10 and 20
- loop {_Roll} times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 5 tick
- set {_Roll} to a random integer between 5 and 10
- loop {_Roll} times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 6 tick
- set {_Roll} to a random integer between 1 and 5
- loop {_Roll} times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 8 tick
- loop 5 times:
- {抽獎中.%player%} is true
- RollLottery(player)
- wait 10 tick
- {抽獎中.%player%} is true
- wait 12 tick
- RollLottery(player)
- set name of item to "&6抽獎"
- set {抽獎中.%player%} to false
- give slot 40 of player's current inventory to player
- on inventory close:
- name of player's current inventory is "&0抽獎":
- {抽獎中.%player%} is true
- set {抽獎中.%player%} to false
- set {_Lottery} to a random integer between 1 and 18
- {_Lottery} is 1:
- give slot 10 of player's current inventory to player
- {_Lottery} is 2:
- give slot 11 of player's current inventory to player
- {_Lottery} is 3:
- give slot 12 of player's current inventory to player
- {_Lottery} is 4:
- give slot 13 of player's current inventory to player
- {_Lottery} is 5:
- give slot 14 of player's current inventory to player
- {_Lottery} is 6:
- give slot 15 of player's current inventory to player
- {_Lottery} is 7:
- give slot 16 of player's current inventory to player
- {_Lottery} is 8:
- give slot 19 of player's current inventory to player
- {_Lottery} is 9:
- give slot 28 of player's current inventory to player
- {_Lottery} is 10:
- give slot 25 of player's current inventory to player
- {_Lottery} is 11:
- give slot 34 of player's current inventory to player
- {_Lottery} is 12:
- give slot 37 of player's current inventory to player
- {_Lottery} is 13:
- give slot 38 of player's current inventory to player
- {_Lottery} is 14:
- give slot 39 of player's current inventory to player
- {_Lottery} is 15:
- give slot 40 of player's current inventory to player
- {_Lottery} is 16:
- give slot 41 of player's current inventory to player
- {_Lottery} is 17:
- give slot 42 of player's current inventory to player
- {_Lottery} is 18:
- give slot 43 of player's current inventory to player
Advertisement
Add Comment
Please, Sign In to add comment