
Lv.1
一直摸鱼一直爽!嘿哈!
签名:编程使我快乐~~
在 耶!做好啦!太棒啦! 中回复
free_end喵ao.cn/u/Free18320431 BZIClaw喵ao.cn/u/wU7oD1SSk4w2ewg?tab=published_maps char_木泽喵ao.cn/u/5Zq3vgfgHV2Hzsw?tab=collection Architect_煎饼喵ao.cn/u/KADJBW
2021-10-30T09:18:02 点赞:0
在 Unity 游戏做完啦! 中回复
百度网盘链接:http去s://pan.baidu.co掉m/s/1w6FQj2EV汉R0KyZyKa8pH39字Q
提取码:2468
2022-01-02T18:13:56 点赞:0
在 求助!帮我康康这段代码该咋弄啊! 中回复
function joinRed(entity) {
entity.addTag('red')//加红队标签
entity.player.color.set(1, 0, 0)//变红
world.say(`${entity.player.name} 是红队`)
}
function joinBlue(entity) {
entity.addTag('blue')//加蓝队标签
entity.player.color.set(0, 0, 1)//变蓝
world.say(`${entity.player.name} 是蓝队`)
}
world.onPlayerJoin(({ entity }) => {
const red = world.querySelectorAll('.red') //红队玩家列表
const blue = world.querySelectorAll('.blue') //蓝队玩家列表
if (red.length === blue.length) {//如果两队人数相同
if (Math.random() < 0.5) {//随机加入其中一队
joinBlue(entity)//加入蓝队
}
else {
joinRed(entity)//加入红队
}
}
else if (red.length > blue.length) {//如果红队人多
joinBlue(entity)//加入蓝队
}
else {
joinRed(entity)//加入红队
}
entity.onFluidEnter(({ voxel , entity }) => {
if(voxels.name(voxel) === 'blueberry_juice') {
if(entity.isPlayer) {
if(entity.hasTag('red')) {
entity.enableDamage = true
entity.hurt(100);
entity.player.forceRespawn()
}
}
}else if(voxels.name(voxel) === 'strawberry_juice') {
if(entity.isPlayer) {
if(entity.hasTag('blue')) {
entity.enableDamage = true
entity.hurt(100);
entity.player.forceRespawn()
}
}
}
})
})2022-04-08T20:54:01 点赞:0
在 aaa,谁知道咋让玩家进入的时候,面向右边 中回复
world.onPlayerJoin(({ entity }) => {
if (entity.isPlayer) {
entity.player.forceRespawn(); // 这个是让玩家回到重生点
entity.player.facingDirection = new Box3Vector3(1, 0, 0);
}
});
这里面的参数自己调(说白了就是我懒)
参数嘛,就是那个 new Box3Vector3
2022-04-08T21:03:16 点赞:0