Hello everyone, I wrote a small script for LiquidBounce NextGen, which, when a player hits, writes to the chat #stop (to stop Baritone, rather than entering the chat and inserting a command). But it doesn't work, LiquidBounce writes in the chat:
[SAPI] BaritoneStopper::playerTick threw
[PolyglotExeption]: ReferenceError: 'Player' is not defined
Help me solve this problem, I haven't worked with js much. :/```
const script = registerScript({
name: "BaritoneStopper",
version: "2.0",
authors: ["NoName"]
});
script.registerModule({
name: "BaritoneStopper",
category: "Movement",
description: "Stops Baritone if you are attacked."
}, (mod) => {
mod.on("playerTick", () => {
if (Player.getHurtTime() > 0) {
Client.displayChatMessage("#stop");
}
});
});