用户:
DebugDynamo查看:6 回复:20 评论:6 创建时间:2022-07-06T16:11:56
world.onTick(({ entity, tick }) => {
if (tick % 2 === 0) { //每两个tick检测一次
world.querySelectorAll('player').forEach(async (jiguang) => {
if(!locks.includes(jiguang.player.name))return
jiguang.point = {
lo: new Box3Vector3(jiguang.position.x - 7, jiguang.position.y - 7, jiguang.position.z - 7),
hi: new Box3Vector3(jiguang.position.x + 7, jiguang.position.y + 7, jiguang.position.z + 7),
}
for (const e of world.searchBox(jiguang.point)) { //获取伤害区域内的所有实体
if (e == jiguang) continue
e.hurt(1/*不要对玩家太过分()外挂点到为止()*/,{
attacker:jiguang
})
hit_fly(jiguang.position,0.1,e)
}
})
}
})
world.addCollisionFilter('player', 'player') //())
const locks = ['BOX.FUN']//外挂的执行者()改成自己的名字()
world.onPlayerJoin(({entity})=>{
entity.enableDamage = true //开启伤害()
with (entity.player) {
jumpPower = 0.56//被改过的屑传奇移速()()
enableDoubleJump = false
jumpSpeedFactor = 1.1
jumpAccelerationFactor = 0.7
runSpeed = 0.35
runAcceleration = 0.20
walkSpeed = 0.17
walkAcceleration = 0.12
crouchSpeed = 0.08
crouchAcceleration = 0.07
cameraMode = Box3CameraMode.FPS;
scale = 0.8
enable3DCursor = true
cameraFovY = 0.3
}
entity.maxHp = 20
entity.hp = 20
})
//某个屑的击飞代码()
async function hit_fly(center/*这里是武器的位置*/, power/*击飞的力量,推荐0.6左右*/, entity/*这是玩家……*/) {// hit fly
entity.velocity = new Box3Vector3(
(entity.position.x - center.x) * power,
(entity.position.y - center.y) * power * 2,
(entity.position.z - center.z) * power
)
}
world.onPress(async ({ entity, raycast, button }) => {
if (button === Box3ButtonType.ACTION0) {
if (raycast.hitEntity) {
if (raycast.distance > 5 || !raycast.hitEntity.isPlayer) return
raycast.hitEntity.velocity.copy(raycast.direction.scale(Math.random() * 2)); {
raycast.hitEntity.hurt(3, {
attacker: entity,
});//跳劈伤害我懒得写()
}
}
return
}
})