用户:
hecos查看:506 回复:22 评论:53 创建时间:2020-04-19T16:31:43
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer===false){
if(other.isPlayer===true){
if(entity.hasTag('car')){
if(other.mesh===''){
other.meshOrientation = new Box3Quaternion(0, 1, 0, 0);//调整方向
other.mesh=entity.mesh;
other.meshScale=entity.meshScale;
other.player.canFly=false;
other.player.invisible=true;
other.player.walkSpeed=2;
other.player.runSpeed=3;
}
}
}
}
});
给车加上car的标签
然后就可以正着开车啦!


怎么下车
点赞0
评论
entity.mesh='';
不是,能不能弄成碰到有某个标签的模型就复原
world.onEntityContact(({entity,other})=>{ if(entity.hasTag('你要的标签')){other.mesh="";} })
>是等于号
Vicent轩怎么下车啊,就是碰到标签为 ofcar 的模型就复原(包括速度)。
回复时,回复给我的代码不要一行写完,非常感谢这位大佬哦~
点赞0
评论
说白了就是不要在下方评论,直接回帖并置顶,这样其他同问的小伙伴就可以看到啦~
置顶了
能不能也跟他一样说一下喵战代码,不用置顶也可以,就是给我说一声就行
枪战代码我给你,往上翻
world.querySelectorAll('.ofcar').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.mesh='';
other.player.invisible=false;
other.player.walkSpeed=0.22;//正常行走速度
other.player.runSpeed=0.4;//正常奔跑速度
other.player.canFly=false;
})
})//此代码不仅用于下车,也用于下任何交通工具,甚至不是交通工具点赞0
评论
谢谢哦~
加在哪?
API
BSS梅者如西额,补充一下飞机的代码,望置顶。首先先把模型加上“飞机”的标签,然后在代码栏里输入一下代码
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer===false){
if(other.isPlayer===true){
if(entity.hasTag('.飞机')){
if(other.mesh===''){
other.meshOrientation = new Box3Quaternion(0, 1, 0, 0);//调整方向
other.mesh=entity.mesh;
other.meshScale=entity.meshScale;
other.player.canFly=true;
other.player.invisible=true;
other.player.walkSpeed=2;
other.player.runSpeed=3;
}
}
}
}
});点赞0
评论
emmmmmmmm
world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
hitEntity.velocity.x += direction.x;
hitEntity.velocity.y += 0.5;
hitEntity.velocity.z += direction.z;
hitEntity.hurt(5 * Math.random() + 5, {
attacker: entity,
});
});
});
//检测攻击代码
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' 击杀了 ' + entity.player.name)
}
entity.player.forceRespawn();
});//死亡后代码
枪战代码![]()
点赞0
评论
emmmm吉吉喵发过
额这个是有bug的
BSS梅者如西现在鱼动不来了!!!你快过来看看啊,链接是box3create.codemao.cn/games/bccd737d6ec213ccff29
点赞0
评论
我怎么进不去那个地图了,被拉黑了吗?
没啊
box3create.codemao.cn/games/bccd737d6ec213ccff29
我怎么一直是载入中?
BSS梅者如西在吗在吗在吗?你是不是把鲁肃的大招做好了,起一个稍微炫酷一点的名字吧,等会给我演示下怎么用(每周天上午我都要上跆拳道,都来不了。)
点赞0
评论
pvp也失效了
就是打不了人
我只能上午来呜
呜呜呜呜
e.
ZNS_哪吒。。
点赞0
评论
。。
????????????????????????????????????????????????????????????????????????????????????????????????????????
BSS梅者如西AI,我找了几个大招看你能不能做出来。
点赞0
评论
进地图我只能到八月了QwQ
哦好吧
emmm
你先把这些大招做了吧
哦遵命
AI看来你放假了
确实
你现在做了几个大招了
抱歉,国王大大,在下暂时没有时间
emmm
我还有11天才解放啊啊啊
报告国王大大,在下把“疾跑”做好了
报告国王大大,在下把“弱化”做好了
报告国王大大,在下把“治疗”做好了
报告国王大大,在下把“终结”做好了
报告国王大大,在下把“眩晕”做好了
emmm