
Lv.1
某只大屑。
在 【KittenV4.11.5版本更新】我相信这个功能大家一定很感兴趣...... 中回复
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2022-12-01T14:18:12 点赞:0
在 求帮助!! 中回复
点击谷歌浏览器(chome)输入编程猫社区,登录你的账号,点击创作,点击神奇代码岛,登录账号,点击上面的链接栏,ctrl+v粘贴,点击回车键。
复制的快捷键ctrl+c复制 ctrl+v粘贴 ctrl+x剪切
你再不会的话我也没办法。
2022-12-09T09:31:44 点赞:0
在 啊啊啊 啊啊 中回复
//将可伤害开启
world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
});
//摔落伤害
world.onVoxelContact(async ({ entity, x, y, z, voxel }) => {
if (!entity.isPlayer) return;
let i = entity.player.fall - y
if (entity.player.fall - y > 10) {
entity.hurt(i * 3)
entity.player.directMessage('你受到了' + i * 3 + '点摔落伤害,目前血量是:' + entity.hp)
}
entity.player.fall = y
});
//处理特殊情况:水方块
world.onFluidEnter(async({entity,voxel})=>{
if(!entity.isPlayer){return;}
entity.player.fall=0
})
//这里的复活代码@吉吉喵
world.onDie(async({ entity }) => {
if (!entity.isPlayer) return;
for (let t = 1; t <= 5; t++) {
entity.player.directMessage(`倒计时 ${String(5 - t)} 秒后复活`);
await sleep(1000);
}
entity.player.forceRespawn();
});
2022-12-13T17:36:44 点赞:0
在 求一下切换视角的代码(含菜单的那种qwq) 中回复
world.onPlayerJoin(async ({ entity }) => {
entity.player.onPress(async ({ button }) => {//右键显示状态栏
if (button == Box3ButtonType.ACTION1) {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `${entity.player.name}的状态栏`,
options: ['视角','进入挂机室','返回存档点','重新开始(慎点)','关注作者','敬请期待']
})
if (sel) {
if (sel.value == '返回存档点') {
entity.position.copy(entity.player.spawnPoint)
entity.position.y += 4
}
else if (sel.value == '重新开始(慎点)') {
entity.player.canFly = false
entity.player.kick()
}
else if (sel.value == '视角') {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `视角\n在使用2D视角(竖面)的时候,要用wasd(电脑)而且w和s会反过来`,
options: ['切换第一人称', '切换第三人称','2D视角(横面)','2D视角(竖面)']
})
if (sel) {
if (sel.value == '切换第一人称') {
entity.player.cameraMode = Box3CameraMode.FPS;
}
else if (sel.value == '切换第三人称') {
entity.player.cameraMode = Box3CameraMode.FOLLOW;
}
else if (sel.value == '2D视角(横面)') {
entity.player.cameraMode=Box3CameraMode.RELATIVE;
entity.player.cameraPosition=new Box3Vector3(0.01,40,0);
entity.player.swapInputDirection=true;
entity.player.reverseInputDirection=Box3InputDirection.HORIZONTAL;
entity.player.cameraFreezedAxis=Box3CameraFreezedAxis.Y;
entity.player.freezedForwardDirection=new Box3Vector3(0,-1,-1);
}
else if (sel.value == '2D视角(竖面)') {
entity.player.cameraMode = "relative"
entity.player.cameraTarget.y = 8
entity.player.cameraPosition.set(0, 0, -15)//3个数随便调,假设是a1,a2,a3,那么这一行的意思就是指从x+a1,y+a2,z+a3的地方看你()
//禁用WS
entity.player.swapInputDirection = true//把这一行注释了后就可以搞事情了(?)
//防止移动出错
entity.player.freezedForwardDirection = new Box3Vector3(1, 1, 0);
entity.collides.boolean = false
}
}
}
else if (sel.value == '关注作者') {
entity.player.link('https://box3.codemao.cn/u/13484066')
}
else if (sel.value == '进入挂机室') {
entity.position.set(166,5,12)
entity.player.dialog({ // 发送对话框
type: Box3DialogType.TEXT,
title: `系统`,
content: `已进入挂机房!`
})
}
}
}
})
})/*关注作者里填你的名字 记得改一下*/2022-12-16T10:30:39 点赞:0