用户:帅气的剑杰查看:25 回复:7 评论:25 创建时间:2020-08-20T15:31:40
如题,碰到模型就能够飞起来的代码求助!!!!
SKQAworld.querySelectorAll('.XX').forEach((e)=>{ //选中所有标签为XX的模型
e.onEntityContact(({entity,other})=>{ //设置碰撞事件
if(!other.isPlayer){return} //防止非玩家实体参与检测
other.canFly=true; //玩家飞行
});
});点赞0
评论
world.querySelectorAll('.啊哈哈').forEach((e)=>{ //选中所有标签为XX的模型
e.onEntityContact(({entity,other})=>{ //设置碰撞事件
if(!other.isPlayer){return} //防止非玩家实体参与检测
world.say('恭喜找到彩蛋!')
other.canFly=true; //玩家飞行
});
});点赞0
评论
world.querySelectorAll('.狗头').forEach((e)=>{ //选中所有标签为XX的模型
e.onEntityContact(({entity,other})=>{ //设置碰撞事件
if(!other.isPlayer){return} //防止非玩家实体参与检测
world.say(entity.player.name+'复原成功!')
});
});点赞0
评论