
Lv.1
签名:正在代码岛,有时候你可以找到我() 正在学js
在 【岛3模型“比武”大赛】吉吉喵招募首席建模师合作官方地图! 中回复
https://box3.codemao.cn/e/a44e5180b2e6ac2a1c00
2021-06-08T18:03:13 点赞:0
在 【岛3模型“比武”大赛】吉吉喵招募首席建模师合作官方地图! 中回复
https://box3.codemao.cn/p/bedwars?team=1&psd=1
2021-06-09T19:07:35 点赞:0
在 【岛3大更新】代码师、音效师,双厨狂喜! 中回复
//控制⾯板
world.onPlayerJoin(({ entity }) => { //玩家进⼊游戏时
entity.player.onPress(async ({ button }) => { //每当有按钮被按下
if (button == Box3ButtonType.ACTION1) { //如果按钮是右键
const selection = await entity.player.dialog({
type: Box3DialogType.SELECT, //对话框类型为选择框
content: `${entity.player.name}`,
title: `控制⾯板`,
options: ['幽灵模式', '管理员特权', '服务器强制崩溃重启'],
})
if (selection) { //确保对话框不是点击x关闭
if (selection.value === '幽灵模式') {
if (entity.player.name == '幻想一笑而过') {
entity.player.spectator = !entity.player.spectator;
} else {
entity.player.dialog({ //弹出对话框
type: Box3DialogType.TEXT, //对话框类型为纯⽂本
content: `你不是管理员`,
title: '系统',
})
}
}
if (selection.value === '服务器强制崩溃重启') {
if (entity.player.name === '幻想一笑而过') {
const selection = await entity.player.dialog({
type: Box3DialogType.SELECT, //对话框类型为选择框
content: `真的确定要重启服务器吗?`,
title: `控制⾯板`,
options: ['是', '否'],
})
if (selection) {
if (selection.value === '是') {
world.say('作者 幻想一笑而过 使用了while循环')
world.say('服务器已强制崩溃即将重启')
while(1){}
}
}
} else {
entity.player.dialog({ //弹出对话框
type: Box3DialogType.TEXT, //对话框类型为纯⽂本
content: `你不是管理员`,
title: '系统',
})
}
}
if (selection.value === '管理员特权') {
if (entity.player.name === '幻想一笑而过' || entity.player.name === '全息碎影孙悟空_' || entity.player.name === '战神_皮卡' || entity.player.name === '四十七师副营长') {
const code = await entity.player.dialog({ //弹出对话框
type: Box3DialogType.INPUT, //对话框类型为输入框
content: `请输入指令`,
title: '系统',
});
try {
world.say('~>' + eval(code));2021-06-11T20:03:59 点赞:1
在 【box3】地形编辑器大赛! 中回复
2021-06-13T07:45:35 点赞:0