Lv.1
一个人
签名:我正在写作业……
在 【代码岛3.0编辑器更新!】添加999个实体,居然很流畅? 中回复
吉吉喵我遇到一个奇怪的bug:我无论在编辑器里还是游戏里(我在游戏里可以飞),我要飞,但是我一飞,跳跃按钮就不见了!
黄鹤楼的地图还有翅膀,不会这样
吉吉喵解决一下这个bug!
2020-02-23T13:27:40 点赞:0
在 求助!!! 中回复
感谢shyfcka!
代码已经没有错误了!
function isAdmin(playerName) {if (['送寒声'].indexOf(playerName) !== -1) {return true;} else {return false;}}
world.onPlayerJoin(({entity}) => {
world.say(entity.player.name + '\n欢迎来到~')
entity.player.enableDamage = true
entity.player.showHealthBar = true
entity.player.dam = 7.5
entity.player.maxHp = 200
entity.player.hp = 175
entity.player.enableActionA = true
if (isAdmin(entity.player.name)) {
entity.player.canFly = true
}
world.onPress(({button, raycast:{hitEntity, direction}}) =>{
if (!button !== 'action0Button' || !hitEntity || isAdmin(hitEntity.player.name)) {
return;
}
hitEntity.player.velocity.x += direction.x
hitEntity.player.velocity.y += 0.5
hitEntity.player.velocity.z += direction.z
hitEntity.hurt(entity.dam, {
attacker: entity,
})
})
})
world.onChat(({entity, message}) => {
if(entity && entity.isPlayer) {
if (isAdmin(entity.player.name)) {
if (message === 'cq1') {
entity.player.spectator = true
} else if (message === 'cq0') {
entity.player.spectator = false
}
}
}
})
world.onDie(({entity, attacker}) => {
(async function() {
if (attacker) {
world.say(attacker.player.name + ' 击杀了 ' + entity.player.name)
}
await sleep(75000)
entity.player.forceRespawn()
})()
})
world.querySelectorAll('.test').forEach((e) => e.enableDamage = true)2020-02-25T10:12:49 点赞:0
在 【代码岛3.0内测第9弹 - 编程!!】首批编程大师招募! 中回复
https://shequ.codemao.cn/community/250617来玩
2020-02-25T11:43:23 点赞:0