View difference between Paste ID: MhnDNjBY and AraKaSCU
SHOW: | | - or go back to the newest paste.
1
#MYSTERY BOX#
2
#MADE BY SKRIPTINFLUFFY#
3
#v:0.1#
4
5
on rightclick on sign:
6
	if line 1 is "Mystery Box" or "MB":
7
		if line 2 is "%{mb.price}%":
8
			set {_mb} to clicked block
9
			if block under {_mb} is a chest:
10
				if {balance.%player%} is more than or equal to 950:
11
					set {_clicked} to {_mb}
12
					remove 950 from {balance.%player%}
13
					message "Starting Mystery Box!"
14
					set {_ritem} to a random element out of {mb.items::*}
15
					wait 1 second
16
					if size of {mb.items::*} is 0:
17
						message "No Items Set!"
18
					else:
19
						give 1 of {_ritem} to player
20
						message "You got %{_ritem}%!"
21
				
22
command /mb [<text>] [<item>] [<number>]:
23
	trigger:
24
		if arg 1 is "add":
25
			if player has permission "mb.additem":
26
				message "Added %arg 2% to Mystery Box!"
27
				add arg 2 to {mb.items::*}
28
		if arg 1 is "remove":
29
			if player has permission "mb.removeitem":
30
				message "Removed %arg 2% from Mystery Box!"
31
				remove arg 2 from {mb.items::*}
32
		if arg 1 is "list":
33
			if arg 2 is not set:
34
				message "LIST:"
35
				message "%{mb.items::*}%"
36
		if arg 1 is "setp":
37
			set {mb.price} to arg 3
38
			message "Price set to: %arg 3%"
39
		if arg 1 is "help":
40
			message "/mb setp (price) - To set Mystery Box price!"
41
			message "/mb list - For list of all items, you added to Mystery Box!"
42
			message "/mb remove (item) - To remove item from Mystery Box!"
43
			message "/mb add (item) - To add item to Mystery Box!"
44
			message "/mb help - For help!"
45
				
46-
#IF YOU DONT HAVE MONEY SKRIPT/PLUGIN - IF YOU HAVE, JUST DELETE CODE BELOW
46+
#IF YOU DONT HAVE MONEY SKRIPT/PLUGIN - IF YOU HAVE, JUST DELETE CODE BELOW