diff --git a/Safeguard anti-cheat B/scripts/index.js b/Safeguard anti-cheat B/scripts/index.js index e310f2b..57ba71e 100644 --- a/Safeguard anti-cheat B/scripts/index.js +++ b/Safeguard anti-cheat B/scripts/index.js @@ -389,6 +389,8 @@ world.afterEvents.entityHitEntity.subscribe(async (data) => { const player = data.damagingEntity; const hurtEntity = data.hitEntity; + const rot = player.getRotation(); + const antiKillaura = (world.scoreboard.getObjective('safeguard:killaura_check') === undefined) ? false : true; const hasWeakness = player.getEffect("weakness"); @@ -406,6 +408,14 @@ world.afterEvents.entityHitEntity.subscribe(async (data) => { player.hitEntities = 0; } + if( + !Number.isInteger(rot.x) && + ( + Number.isInteger(rot.x) || Number.isInteger(rot.y) + )) { + world.sendMessage(`§6[§eSafeGuard§6]§r §c§l${player.name}§r§4 was detected using killaura by attacking with rotations: §l§c${rot.x} | ${rot.y} !`); + } + if(!hasWeakness) player.runCommandAsync(`scoreboard players add @s safeguard:cps 1`); }) @@ -626,4 +636,4 @@ world.afterEvents.entityHurt.subscribe((data) => { } } -}) \ No newline at end of file +})