用户:
幸福快乐喵查看:11 回复:4 评论:11 创建时间:2021-07-29T09:27:09
我要代码
成功关注
SHEL深空无尽world.onPress(({ button }) => {
if (button === Box3ButtonType.ACTION1) {//如果按下右键
entity.hp += 100//使玩家的hp(血量)增加100,相当于复活
}
});
点赞0
评论
BSS梅者如西楼下的没用
world.onPress(({ button,entity }) => {
if (button === Box3ButtonType.ACTION1) {
entity.hp = entity.maxHp
}
});点赞0
评论
Alone_47622两个代码你可以选一个,但都是只有当玩家倒地之后点击右键才有用
//这个代码让玩家原地复活
world.onPress(({ entity, button }) => {
if (entity.player.dead && button == 'action1') {
entity.hp = entity.maxHp
}
})
//这个代码让玩家在重生点复活
world.onPress(({ entity, button }) => {
if (entity.player.dead && button == 'action1') {
entity.player.forceRespawn()
}
})点赞2
评论