Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Safeguard anti-cheat B/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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`);
})

Expand Down Expand Up @@ -626,4 +636,4 @@ world.afterEvents.entityHurt.subscribe((data) => {
}
}

})
})