
Lv.1
仰首望月,风拂鬓,独自凭栏。泪落缓;北斗阑干,兴衰轮换。往事成殇几月霜,枫林黄鹤终得散
签名:在岛3上度假ing~ 基本退社区 徒弟:ZHCEson、李朝睿 看什么看,没有了!
在 谁能给我点代码 中回复
var teleportPlayer = ''//定义传送玩家变量
world.onChat(({entity,message})=>{
if (message.startsWith('/tp')){//如果以'/tp'开头
teleportPlayer = message.slice(4)//这里是四因为要空格
world.querySelectorAll('player').forEach((x)=>{//遍历玩家列表
if (x.player.name == teleportPlayer){
entity.position.copy(x.position)//传送
world.say('已将'+entity.player.name+'传至'+x.player.name)//提示语
}
})
}
})2020-10-08T19:29:28 点赞:2
在 【干货!】box3.0 中回复
第二个,如何写一个装备代码呢?示例,写一个“写代码”的装备:

world.onPlayerJoin(({ entity }) => {
if (entity.player.name === "J_K_Hermione_build白泽")
entity.player.a喵Wearable({
bodyPart: Box3BodyPart.HEAD,
mesh: 'mesh/写代码.vb',
scale: new Box3Vector3(0.5, 0.5, 0.5),//模型大小长宽高都缩小0.5倍
orientation: new Box3Quaternion(0, 1, 0, 1),//将模型的旋转角度调整
offset: new Box3Vector3(0, 0.8, 1),//装备的位置,向人背后偏移一些
});
});
2020-10-09T22:41:27 点赞:1
在 【干货!】box3.0 中回复
第三个,如何蹲下回血?想月球大战里面的一样呢?上代码:
world.onPress(({button,entity},) => {
//console.log(button)
if (button == 'crouch') {
if (entity.hp < entity.maxHp) {
back = entity.maxHp+50
//backF(entity,back)
} else {
entity.hp = entity.maxHp
}
}
})2020-10-09T22:45:05 点赞:1
在 【干货!】box3.0 中回复
第四个,简单的上下车代码,但很实用哦~
(可以把雷电猴换成其他的哦)
world.querySelectorAll('#雷电猴-1').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.mesh=entity.mesh;
other.meshScale=entity.meshScale;
other.meshOrientation = new Box3Quaternion(0, 0, 0, 0);//这段代码没法左右旋转
other.player.invisible=true;
world.say(other.player.name+' 你带走了雷电猴')
world.say('说我要下车就可以下车了')
})
})
world.onChat(({message,entity})=>{
if(message==='我要下车'){
entity.mesh='';
entity.player.invisible=false;
world.say(entity.player.name+'下了车')
}
})2020-10-09T22:47:33 点赞:0
在 【干货!】box3.0 中回复
第五个,PVP代码(大佬不喜勿喷)
orld.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
if(hitEntity.isPlayer===true){
hitEntity.velocity.y += 0.5;
}
hitEntity.hurt(20 * Math.random() + 5, {
attacker: entity,
});
if(entity.player.name == "J_K_Hermione_build白泽"){//这是外挂
hitEntity.hurt(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, {
attacker: entity,
});
}
});
});
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' 击杀了 ' + entity.player.name)
}
entity.player.forceRespawn();
});//pvp代码、2020-10-09T22:49:39 点赞:0
在 【干货!】box3.0 中回复
第六个,一个管理员代码,希望大家喜欢:
world.onChat(({ entity, message }) => {
if (entity && entity.isPlayer) {
if (entity && 'J_K_Hermione_build白泽'.split(' ').indexOf(entity.player.name) != -1 && message.charAt(0) == '$') {
try {
entity.player.directMessage('<~ ' + eval(message.split('$')[1]))
} catch (err) {
entity.player.directMessage('Error:' + err)
}
};
}
})2020-10-09T22:52:09 点赞:0
在 【干货!】box3.0 中回复
大佬来帮忙吖:我的地图https://box3create.codemao.cn/games/03cf1ff83d99c5f5cae7
2020-10-09T22:57:40 点赞:0
在 找box3师傅 中回复
我来吧
链接我的地图:https://box3create.codemao.cn/games/03cf1ff83d99c5f5cae7
2020-10-10T15:36:01 点赞:0
在 装备代码(刀+钻石剑+3级头) 中回复
world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/自制钻石剑.vb', orientation: new Box3Quaternion(0, 1, 0, 0).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0, -0.3), }); }); world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/刀.vb', orientation: new Box3Quaternion(0, 1, -0.5, 0).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0, -0.3), }); }); world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/三级盔.vb', orientation: new Box3Quaternion(0, 1, 0, 10).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0.9, 0), }); });
world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/自制钻石剑.vb', orientation: new Box3Quaternion(0, 1, 0, 0).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0, -0.3), }); }); world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/刀.vb', orientation: new Box3Quaternion(0, 1, -0.5, 0).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0, -0.3), }); }); world.onPlayerJoin(({ entity }) => { entity.player.a喵Wearable({ bodyPart: Box3BodyPart.TORSO, mesh: 'mesh/三级盔.vb', orientation: new Box3Quaternion(0, 1, 0, 10).rotateY(Math.PI/2), scale: new Box3Vector3(0.9, 0.9, 0.9), offset: new Box3Vector3(0, 0.9, 0), }); }); 2020-10-12T11:33:24 点赞:0
在 代号“守护岛3”——吉吉喵拯救计划启动! 中回复
https://box3.codemao.cn/p/edumon?ref=Lfus4aJnv5ysLPtQ
2021-01-01T20:40:55 点赞:0