Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. TargetControll

TargetControll

Scheduled Pinned Locked Moved Unsolved ScriptAPI
1 Posts 1 Posters 639 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asgerblau
    wrote on last edited by
    #1

    ///api_version=2
    const script = registerScript({
    name: "VKKILLAURA",
    authors: [":)"],
    version: "1.0"
    }).import("Core.lib");

    // Indstillinger for KillAura
    const rangeValue = value.createFloat("Range", 4.0, 3.0, 6.0);
    const cpsValue = value.createInteger("CPS", 10, 1, 20);
    const rotationSpeedValue = value.createList("RotationSpeed", ["Slow", "Medium", "Fast"], "Medium");

    // Mål liste
    const targetList = [];
    let isEnabled = false;

    // Opdatering af mållisten
    function updateTargetList(name, action) {
    if (action === "add" && !targetList.includes(name)) {
    targetList.push(name);
    Client.displayChatMessage(§aAdded ${name} to target list.);
    } else if (action === "remove") {
    const index = targetList.indexOf(name);
    if (index > -1) {
    targetList.splice(index, 1);
    Client.displayChatMessage(§cRemoved ${name} from target list.);
    }
    }
    }

    // Registrer kommandoer
    script.registerCommand({
    name: ".vk",
    description: "Manage KillAura target list.",
    hub: true,
    subcommands: [
    {
    name: "add",
    parameters: [{ name: "name", required: true }],
    onExecute(name) {
    updateTargetList(name, "add");
    }
    },
    {
    name: "remove",
    parameters: [{ name: "name", required: true }],
    onExecute(name) {
    updateTargetList(name, "remove");
    }
    },
    {
    name: "list",
    onExecute() {
    if (targetList.length === 0) {
    Client.displayChatMessage("§eTarget list is empty.");
    } else {
    Client.displayChatMessage("§eTargets: " + targetList.join(", "));
    }
    }
    },
    {
    name: "toggle",
    onExecute() {
    isEnabled = !isEnabled;
    Client.displayChatMessage(§eKillAura is now ${isEnabled ? "enabled" : "disabled"}.);
    }
    }
    ]
    });

    // Hent mål inden for rækkevidde
    function getTargetsInRange(range) {
    const targets = [];
    for (const entity of mc.theWorld.loadedEntityList) {
    if (entity !== mc.thePlayer && entity.getDistanceToEntity(mc.thePlayer) <= range) {
    targets.push(entity);
    }
    }
    return targets;
    }

    // Angrebsmål
    function attackTarget(target) {
    if (targetList.includes(target.getName())) {
    mc.thePlayer.swingItem();
    mc.playerController.attackEntity(mc.thePlayer, target);
    }
    }

    // Opdatering af angreb
    script.on("update", () => {
    if (!isEnabled) return;

    const targets = getTargetsInRange(rangeValue.get());
    for (const target of targets) {
        attackTarget(target);
        sleep(1000 / cpsValue.get()); // CPS
    }
    

    });

    // Aktiver modulet
    script.on("enable", () => {
    Client.displayChatMessage("§eVKKILLAURA module enabled.");
    });

    // Deaktiver modulet
    script.on("disable", () => {
    isEnabled = false;
    targetList.length = 0; // Rydder mål listen
    Client.displayChatMessage("§eVKKILLAURA module disabled.");
    });

    This dose not work at all, i made it with chatgpt and i have no coding experience, what i want it to do is to make killaura target the players on the list i can interact with the list with these commands:
    .vka -active/deactivate
    .vk "Name" -adds a player
    .vkf "name" -removes a player
    .vkl -shows the list

    I hope that someone can help me fix the script so that i can target the players i want- Thanks!

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    About
    • Terms of Service
    • Privacy Policy
    • Status
    • Contact Us
    Downloads
    • Releases
    • Source code
    • License
    Docs
    • Tutorials
    • CustomHUD
    • AutoSettings
    • ScriptAPI
    Community
    • Forum
    • Guilded
    • YouTube
    • Twitter
    • D.Tube
    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups