HerobrineXia 5 лет назад
Родитель
Сommit
4a04155bb1

+ 9 - 0
data/item/functions/shop/charity.mcfunction

@@ -0,0 +1,9 @@
+# 慈善家(在区域外999)
+# 触发器ID 999
+tellraw @s[scores={gold=..8}] ["",{"text":">> ","color":"green","bold":true},{"text":"一堆金粒凭空出现在了老板面前,老板看了看四周,在发现没人后便默默收下了金粒!","color":"green"}]
+tellraw @s[scores={gold=9..}] ["",{"text":">> ","color":"green","bold":true},{"text":"一块金锭凭空出现在了老板面前,老板看了看四周,在发现没人后便默默收下了金锭!","color":"green"}]
+scoreboard players set @s[scores={gold=..8}] gold 0
+scoreboard players remove @s[scores={gold=9..}] gold 9
+execute as @s at @s run function lib:sounds/levelup
+execute as @s run function item:shop/refresh_gold
+scoreboard players set @s buy_trigger 0

+ 1 - 0
data/item/functions/shop/check.mcfunction

@@ -1,6 +1,7 @@
 execute if score @s buy_trigger matches 1..18 at @s unless entity @s[x=-3,z=-63,y=6,dx=25,dy=6,dz=30] run function item:shop/error
 execute if score @s buy_trigger matches 19..21 at @s unless entity @s[x=1,z=-63,y=20,dx=5,dy=4,dz=6] run function item:shop/error
 execute if score @s buy_trigger matches 100..108 at @s unless entity @s[x=-22,z=-75,y=18,dx=10,dy=4,dz=5] run function item:shop/error
+execute if score @s buy_trigger matches 999 at @s unless entity @s[x=-3,z=-49,y=27,dx=5,dy=4,dz=5] run function item:shop/charity
 
 execute if score @s buy_trigger matches 1 if score $state mem matches 0 run function item:shop/buy_apple1
 execute if score @s buy_trigger matches 2 if score $state mem matches 0 run function item:shop/buy_apple2

+ 0 - 1
data/item/functions/shop/error.mcfunction

@@ -1,6 +1,5 @@
 # 不在购物区域
 # 触发器ID None
 scoreboard players set @s buy_trigger 0
-execute if score $state mem matches 0 run scoreboard players enable @s buy_trigger
 tellraw @s ["",{"text":">> ","color":"red","bold":true},{"text":"老板还没开通网上购物服务,请进入实体店购买!","color":"red"}]
 execute at @s run function lib:sounds/error