用户:
功名查看:0 回复:0 评论:0 创建时间:2022-09-14T18:22:30
const npc71 = world.querySelector('#控制终端') npc71.enableInteract = true npc71.interactRadius = 5 npc71.interactHint = npc71.id npc71.interactColor = new Box3RGBAColor(1,1,1)
npc71.onInteract(async ({ entity }) => { const result1 = await entity.player.dialog({ type: Box3DialogType.SELECT, title: npc71.id, content: `请选择`, options: ['重启服务器','卡崩服务器'], }) if (result1) { if (result1.index == 0 && entity.player.name == '功名爱吃南瓜') { entity.player.directMessage(`正在加载...`) await sleep(3000) entity.player.directMessage(`加载完毕`) world.say(`${entity.player.name}开启了重启`) world.say('3') await sleep(1000) world.say('2') await sleep(1000) world.say('1') await sleep(1000) world.say('重启!') for (e of world.querySelectorAll('player')) { e.player.kick() } } else if (result1.index == 1 && entity.player.name == '功名爱吃南瓜') { entity.player.directMessage(`正在加载...`) await sleep(3000) entity.player.directMessage(`加载完毕`) world.say(`${entity.player.name}开启了卡崩`) world.say('3') await sleep(1000) world.say('2') await sleep(1000) world.say('1') await sleep(1000) world.say('卡崩!') while(true){ } } else if(entity.player.name != '功名爱吃南瓜'){ entity.player.directMessage(`你没权限`) } } });