请选择 进入手机版 | 继续访问电脑版
查看: 226|回复: 4

[命令方块] 我的世界股票系统

[复制链接]

1

主题

12

帖子

4

积分

Lv.1 新手木匠

UID
1975009
小麦
0
金锭
49
下界之星
0
发表于 2019-10-21 13:17:16 | 显示全部楼层 |阅读模式
股票系统   欢迎来我们的服务器参观    服务器号:86801743

变量部分
/summon armor_stand ~ ~-0.5 ~ {Invisible:1,NoGravity:1,CustomName:"矿业板块",CustomNameVisible:1}
/scoreboard objectives add gj dummy 股票价格
/scoreboard objectives add gs dummy 股票数量
scoreboard objectives add a1 dummy
scoreboard objectives add a2 dummy
scoreboard objectives add a3 dummy

探测部分
scoreboard players test 矿业板块 a1 0 0
scoreboard players test 矿业板块 a2 0 0
scoreboard players test 矿业板块 a3 0 0
scoreboard players test 矿业板块 gs 100 10000000
setblock -35 4 -903 redstone_block

赋值部分
/scoreboard players set 矿业板块 a1 100
scoreboard players operation 矿业板块 a1 *= 矿业板块 gj
/scoreboard players operation 矿业板块 a2 += @p aaa
setblock -35 4 -903 air
setblock -35 4 -901 redstone_block

探测玩家的钱是否购买股票
/scoreboard players operation 矿业板块 a2 -= 矿业板块 a1
/scoreboard players operation 矿业板块 a3 += 矿业板块 a2
setblock -35 4 -901 air
scoreboard players test 矿业板块 a3 0 10000000
setblock -35 4 -899 redstone_block


钱数不够跳出
scoreboard players test 矿业板块 a3 -10000000 -1       循环
tellraw @p [{"text":"[系统消息]:","bold":"true","color":"green"},{"text":"你的钱数不够买股票!~","bold":"true","color":"red"}]
scoreboard players set 矿业板块 a1 0
scoreboard players set 矿业板块 a2 0
scoreboard players set 矿业板块 a3 0

交易部分
/scoreboard players operation @p aaa -= 矿业板块 a1
/scoreboard players add @p gs 100
/scoreboard players remove 矿业板块 gs 100
/scoreboard players operation 矿业板块 aaa += 矿业板块 a1
tellraw @p [{"text":"[系统消息]:","bold":"true","color":"green"},{"text":"交易已完成!~","bold":"true","color":"red"}]
setblock -35 4 -899 air
setblock -35 4 -897 redstone_block

重置
scoreboard players set 矿业板块 a1 0
scoreboard players set 矿业板块 a2 0
scoreboard players set 矿业板块 a3 0
setblock -35 4 -897 air

--------------------------------------------------------------------------------------------------------------------
scoreboard objectives add a11 dummy
scoreboard objectives add a11 dummy



收购股票

条件检测
scoreboard players test @p gs 100 1000000
scoreboard players test 矿业板块 a11 0 0
scoreboard players test 矿业板块 a12 0 0
scoreboard players set 矿业板块 a11 100
setblock -38 4 -886 redstone_block


运算
scoreboard players operation 矿业板块 a11 *= 矿业板块 gj
scoreboard players remove @p gs 100
scoreboard players operation @p aaa += 矿业板块 a11
scoreboard players operation 矿业板块 aaa -= 矿业板块 a11
scoreboard players add 矿业板块 gs 100

setblock -38 4 -888 redstone_block

重置
/scoreboard players set 矿业板块 a11 0
setblock -38 4 -888 air

1

主题

12

帖子

4

积分

Lv.1 新手木匠

UID
1975009
小麦
0
金锭
49
下界之星
0
 楼主| 发表于 2019-10-21 13:18:58 | 显示全部楼层
本帖最后由 仙境2 于 2019-10-21 19:41 编辑

自己再做一个价格浮动器 就完美大吉了
52.png
头像被屏蔽

1

主题

12

帖子

4

积分

Lv.1 新手木匠

UID
1975009
小麦
0
金锭
49
下界之星
0
 楼主| 发表于 2019-10-21 13:58:10 | 显示全部楼层
提示: 该帖被管理员或版主屏蔽

81

主题

1396

帖子

750

积分

Lv.6 附魔大师

UID
55896
小麦
313
金锭
757
下界之星
0
发表于 2019-10-21 16:56:44 | 显示全部楼层
没有图,不知道为什么,不知道怎么用,就是不知道为什么
我叫"381"也从未相识,我们曾未情,奈何入此

23

主题

108

帖子

52

积分

Lv.3 矿物能手

UID
6384148
小麦
0
金锭
208
下界之星
0
发表于 4 天前 | 显示全部楼层
又想骗我投资股票惹
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

返回顶部