
Lv.1
念往昔岁月
签名:dao3 羽岚.龍族[原]:Aoken 是我 2022-05-29 22:55:02 注册此账号 如想知道自己账号注册时间 记得先登录好账号可打开:https://api.codemao.cn/web/users/details 查看create_time的数字 并在 https://tool.lu/timestamp/ 进行时间轴转换
在 教程:背包换武器 勿喷! 中回复
排版
world.onPress(async ({ button,entity }) => {
if (button != Box3ButtonType.ACTION1 || !entity.isPlayer || entity.player.dead)return;
const result = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: `${entity.player.name}的状态`,
options: ['切换武器', '切换视角', '脱离卡点'],
});
if (!result || result === null) return; // 判断玩家选了什么选项。
switch (result.index) {
case 0:
const result = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `切换魔法`,
options: ['剑', '剑之刃', '蓝之剑', '圣之法杖', '冰——喵', '法仗', '星月权杖', '穹破刀', '弓']
});
if (!result || result === null) return;
switch (result.index) {
case 0:
entity.fashuy = 1
entity.fashu = `剑`
entity.act = 90
const handWears = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/剑.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.4, 1.4),
});break;
case 1:
entity.fashuy = 2
entity.fashu = `剑之刃`
entity.act = 120
const handWears1 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears1[0]);
entity.player.directMessage(`切换成功`);
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/剑之刃.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
offset: new Box3Vector3(-0.05, 0.4, 1.4),
});break;
case 2:
entity.fashu = `蓝之剑`
entity.act = 105
const handWears2 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears2[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/蓝之剑.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.4, 1),
});break;
case 3:
entity.fashu = `圣之法杖`
entity.act = 130
const handWears3 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears3[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/圣之法杖.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2.5),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.2, 0.4)
});break;
case 4:
entity.fashu = `冰——喵`
entity.act = 150
const handWears4 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears4[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/冰——喵.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.4, 1),
});break;
case 5:
entity.fashu = `法仗`
entity.act = 170
const handWears5 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears5[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/法仗.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.4, 1),
});break;
case 6:
entity.fashu = `星月权杖`
entity.act = 125
const handWears6 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears6[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/星月权杖.vb',
orientation: new Box3Quaternion(0, 1, -3, 9).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.55, 0.4),
offset: new Box3Vector3(0, 0.7, 0.6),
});break;
case 7:
entity.fashu = `穹破刀`
entity.act = 135
const handWears7 = entity.player.wearables(Box3BodyPart.RIGHT_HAND);
entity.player.removeWearable(handWears7[0]);
entity.player.directMessage(`切换成功`)
entity.player.addWearable({
bodyPart: Box3BodyPart.RIGHT_HAND,
mesh: 'mesh/穹破刀.vb',
orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI / 2),
scale: new Box3Vector3(0.4, 0.7, 0.4),
offset: new Box3Vector3(-0.05, 0.4, 1),
});
}break;
case 1:
const result1 = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: `${entity.player.name}的状态`,
content: `视角切换`,
options: ['第一人称', '第三人称']
});
if (!result1 || result1 === null) return;
switch (result1.index) {
case 0:
entity.player.cameraMode = 'FPS'
break;
case 1:
entity.player.cameraMode = 'FOLLOW'
break;
default:
}
case 2: entity.position.set(54, 10, 58);break;
default:
}
});
world.onPlayerJoin(({ entity }) => {
Object.assign(entity, {
particleRate: 7,
particleSize: [2, 4, 8, 4, 10],
particleColor: [
new Box3RGBColor(10, 9, 2),
new Box3RGBColor(5, 0.25, 0.1),
new Box3RGBColor(3, 0.05, 0.05),
new Box3RGBColor(0, 0, 0),
new Box3RGBColor(0, 0, 0),
],particleLifetime: 1,
particleVelocitySpread: new Box3Vector3(2, 2, 2),
});
});

2023-05-07T16:41:23 点赞:2