Kour.io Zeph Menu

Speed Hack, Invisibility, And many more. "Insert" to open menu.

Size

64.8 KB

Version

4.1

Created

Oct 24, 2025

Updated

about 2 months ago

1// ==UserScript==
2// @name         Kour.io Zeph Menu
3// @match        *://kour.io/*
4// @version      4.1
5// @author       Happyjeffery, Rasperiiii & suppress
6// @icon         https://i.imgur.com/11sYWVM.png
7// @description  Speed Hack, Invisibility, And many more. "Insert" to open menu.
8// @run-at       document-start
9// @grant        unsafeWindow
10// @namespace https://greasyfork.org/users/1369586
11// @downloadURL https://update.greasyfork.org/scripts/526361/Kourio%20Zeph%20Menu.user.js
12// @updateURL https://update.greasyfork.org/scripts/526361/Kourio%20Zeph%20Menu.meta.js
13// ==/UserScript==
14
15(function () {
16    ("use strict");
17
18    /***************************************
19   * Performance.now Speed Hack
20   ***************************************/
21    const originalPerfNow = performance.now.bind(performance);
22
23    function updatePerformanceNow(multiplier) {
24        if (multiplier === 1) {
25            performance.now = originalPerfNow;
26            return;
27        }
28
29        performance.now = new Proxy(originalPerfNow, {
30            apply(target, thisArg, argArray) {
31                try {
32                    throw new Error();
33                } catch (e) {
34                    if (!e.stack.includes("invoke_")) {
35                        return target.apply(thisArg, argArray) * multiplier;
36                    }
37                }
38                return target.apply(thisArg, argArray);
39            },
40        });
41    }
42
43    updatePerformanceNow(1);
44
45    /***************************************
46     * Invisibility + Instakill
47     ***************************************/
48    const Signatures = {
49        damageTaken: "f3 04 c8 02 f5 15 04",
50        updateState: "f3 02 fd 02 f4 03 c8",
51    };
52
53    function hexOf(buf) {
54        return Array.from(new Uint8Array(buf))
55            .map((b) => b.toString(16).padStart(2, "0"))
56            .join(" ");
57    }
58
59    function shouldBlockDamage(ev) {
60        return (
61            ev.data instanceof ArrayBuffer &&
62            hexOf(ev.data).startsWith(Signatures.damageTaken) &&
63            kourInstance.config.Invisible
64        );
65    }
66
67    /***************************************
68     * AntiAim
69     ***************************************/
70    const HEADER_SIG = [0xf3, 0x02, 0xfd, 0x02, 0xf4, 0x03];
71    const SAFE_MIN_LENGTH = 70;
72
73    function arrayStartsWith(arr, prefix) {
74        if (arr.length < prefix.length) return false;
75        for (let i = 0; i < prefix.length; i++) {
76            if (arr[i] !== prefix[i]) return false;
77        }
78        return true;
79    }
80
81    function isSafeToModify(packet) {
82        return packet.byteLength >= SAFE_MIN_LENGTH && !kourInstance.config.Invisible && kourInstance.config.AntiAim;
83    }
84
85    function modifyPacket(packet) {
86        const view = new DataView(packet.buffer, packet.byteOffset, packet.byteLength);
87
88        let x = view.getFloat32(28, true);
89        const xDelta = Math.random() < 0.5 ? -0.2 : 0.2;
90        x += xDelta;
91        view.setFloat32(28, x, true);
92
93        let z = view.getFloat32(36, true);
94        const zDelta = Math.random() < 0.5 ? -0.2 : 0.2;
95        z += zDelta;
96        view.setFloat32(36, z, true);
97
98        //console.log(`[Packet Modified] X: ${x.toFixed(2)}, Z: ${z.toFixed(2)}`);
99
100        return packet;
101    }
102
103    /***************************************
104 * Spinbot Angle Modifier
105 ***************************************/
106    const crazyNumbers = [
107        3822588238527201280.00, -1857736430059520.00, 0.00, -0.00, -1.4284511533486216e+24,
108        -0.00, 0.00, 0.12, -1.8763868419170566e+22, 0.00, 556457979374085341184.00, 0.00,
109        -228963383699832832.00, -0.00, 478289722746077184.00, 0.00, -1707527.88, 0.00,
110        2.0849836473005435e+26, -0.00, 343366451878428672.00, -0.00, 0.00, -0.00, -398.99,
111        -7.327271464138011e+37, -0.00, 7.479676797675635e+34, 6077727.50, -112678365030856523776.00,
112        64406255347955662848.00, -0.00, 3.9367609144474995e+28, -0.68, -4.1272324222675643e+34,
113        0.00, -34401746419712.00, 256284.98, -0.00, -992099.94, -46124.25, -0.00, -0.23,
114        3573135.75, -0.00, 3.4937574108676156e+24, 31446140.00, -0.00, 0.00,
115        -2.633920784508417e+22, 1.5002101046880594e+23, -662611.81, 0.00, -7.82,
116        2.1554711763577515e+33, -4781238408011841536.00, -8.267893275317273e+33, -0.00, 0.00,
117        -4.7050078084659084e+24, 63447551577279168512.00, 0.00, 5.614778816753592e+36, 5183327.50,
118    ];
119
120    let currentIndex = 0;
121    const ANGLE_OFFSET = 0x38;
122
123    /***************************************
124     * WebSocket Hooking
125     ***************************************/
126    (function hookWS() {
127        const OrigWS = unsafeWindow.WebSocket;
128        unsafeWindow.WebSocket = function (...args) {
129            const ws = new OrigWS(...args);
130
131            const { addEventListener } = ws;
132            ws.addEventListener = (type, fn, opts) =>
133            addEventListener.call(
134                ws,
135                type,
136                type === "message" ? (ev) => shouldBlockDamage(ev) || fn(ev) : fn,
137                opts
138            );
139
140            const protoDesc = Object.getOwnPropertyDescriptor(OrigWS.prototype, "onmessage");
141            Object.defineProperty(ws, "onmessage", {
142                set(fn) {
143                    protoDesc.set.call(this, (ev) => shouldBlockDamage(ev) || fn(ev));
144                },
145                get() {
146                    return protoDesc.get.call(this);
147                },
148            });
149
150            const originalSend = ws.send;
151            ws.send = function (data) {
152                if (data instanceof ArrayBuffer || data instanceof Uint8Array) {
153                    let packet = data instanceof Uint8Array ? data : new Uint8Array(data);
154
155                    const hex = hexOf(packet);
156
157                    if (hex.startsWith(Signatures.updateState) && kourInstance.config.Instakill) {
158                        for (let i = 0; i < 41; i++) originalSend.call(ws, data);
159                        return;
160                    }
161
162                    if (arrayStartsWith(packet, HEADER_SIG)) {
163                        if (isSafeToModify(packet)) {
164                            packet = modifyPacket(packet);
165                            data = packet.buffer;
166                        }
167
168                        if (kourInstance.config.SpinBot && packet.byteLength >= ANGLE_OFFSET + 4 && !kourInstance.config.Invisible) {
169                            const view = new DataView(data);
170                            const num = crazyNumbers[currentIndex];
171
172                            view.setFloat32(ANGLE_OFFSET, num, true);
173
174                            currentIndex++;
175                            if (currentIndex >= crazyNumbers.length) currentIndex = 0;
176                        }
177                    }
178                }
179
180                return originalSend.call(this, data);
181            };
182
183            return ws;
184        };
185
186        unsafeWindow.WebSocket.prototype = OrigWS.prototype;
187    })();
188
189    /***************************************
190     * Config Object
191     ***************************************/
192    class Kour {
193        constructor() {
194            this.config = {
195                Invisible: true,
196                Instakill: false,
197                AntiAim: false,
198                SpinBot: false,
199                airStrafing: true,
200            };
201        }
202    }
203
204    const kourInstance = new Kour();
205    unsafeWindow.kourInstance = kourInstance;
206
207    /***************************************
208   * Weapon Changer (Lobby Only!)
209   ***************************************/
210    const weapons = [
211        { name: "AK-47", id: "0" },
212        { name: "Deagle", id: "1" },
213        { name: "AWP", id: "2" },
214        { name: "Bayonet", id: "3" },
215        { name: "Uzi", id: "4" },
216        { name: "PKM", id: "5" },
217        { name: "Revolver", id: "6" },
218        { name: "RPG", id: "7" },
219        { name: "USPS", id: "8" },
220        { name: "MP5", id: "9" },
221        { name: "Shotgun", id: "10" },
222        { name: "Glock", id: "11" },
223        { name: "Karambit", id: "12" },
224        { name: "Knife", id: "13" },
225        { name: "Scar", id: "14" },
226        { name: "Minigun", id: "15" },
227        { name: "Famas", id: "16" },
228        { name: "Vector", id: "17" },
229        { name: "Flamethrower", id: "18" },
230        { name: "Kar98k", id: "19" },
231        { name: "M4A4", id: "20" },
232        { name: "Tec-9", id: "21" },
233        { name: "CZ", id: "22" },
234        { name: "Berretta92fs", id: "23" },
235        { name: "AK-109", id: "24" },
236        { name: "P90", id: "25" },
237        { name: "Thompson", id: "26" },
238        { name: "UMP45", id: "27" },
239        { name: "XM1014", id: "28" },
240        { name: "Butterfly", id: "29" },
241        { name: "Laser Gun", id: "30" },
242        { name: "Bomb", id: "31" },
243        { name: "Smoke Grenade", id: "32" },
244        { name: "Molotov", id: "33" },
245        { name: "Grenade", id: "34" },
246        { name: "Flashbang", id: "35" },
247        { name: "Glizzy", id: "36" },
248        { name: "Axe", id: "37" },
249        { name: "Bare Fists", id: "38" },
250    ];
251
252    function setSecondaryWeapon(weaponID) {
253        firebase
254            .database()
255            .ref("users/" + firebase.auth().currentUser.uid)
256            .child("overrideWeaponIndexes1")
257            .set(weaponID);
258        showUserDetails(
259            firebase.auth().currentUser.email,
260            firebase.auth().currentUser
261        );
262    }
263
264    function setMeleeWeapon(weaponID) {
265        firebase
266            .database()
267            .ref("users/" + firebase.auth().currentUser.uid)
268            .child("overrideWeaponIndexes2")
269            .set(weaponID);
270        showUserDetails(
271            firebase.auth().currentUser.email,
272            firebase.auth().currentUser
273        );
274    }
275
276    /***************************************
277   * Skin Changer (Lobby Only!)
278   ***************************************/
279
280    const skins = [
281        { name: "KBI Agent", id: "12" },
282        { name: "James Kour", id: "13" },
283        { name: "President", id: "14" },
284        { name: "Doctor", id: "15" },
285        { name: "Trickster", id: "16" },
286        { name: "Royal Guard", id: "17" },
287        { name: "Xmas", id: "18" },
288        { name: "Kelvis", id: "19" },
289        { name: "Princess Pink", id: "20" },
290        { name: "Princess White", id: "21" },
291        { name: "Princess Bee", id: "22" },
292        { name: "Princess Leaf", id: "23" },
293        { name: "Koura Kraft", id: "24" },
294        { name: "Green Hologram", id: "25" },
295        { name: "Hologrape", id: "26" },
296        { name: "Peter", id: "27" },
297        { name: "Chicken", id: "28" },
298        { name: "Chickoletta", id: "29" },
299        { name: "Kyle", id: "30" },
300        { name: "Shadowgram", id: "32" },
301        { name: "IceBunny", id: "33" },
302        { name: "CocoBunny", id: "34" },
303        { name: "Kourean", id: "35" },
304        { name: "KourG", id: "36" },
305        { name: "Hackour", id: "37" },
306        { name: "Golden Hackour", id: "38" },
307        { name: "Gas Man", id: "39" },
308        { name: "Terrorist", id: "40" },
309        { name: "Counter Terrorist", id: "41" },
310        { name: "Ambush", id: "42" },
311        { name: "Baby Kour", id: "43" },
312        { name: "Poacher", id: "44" },
313        { name: "Astronaut", id: "45" },
314        { name: "Kour Parrot", id: "46" },
315        { name: "Kour Pirate", id: "47" },
316        { name: "Legionaut", id: "48" },
317        { name: "Blue Hologram", id: "49" },
318        { name: "Mr Wireframe", id: "50" },
319        { name: "Mythian", id: "51" },
320        { name: "Kour Trooper", id: "52" },
321        { name: "Kour Craft", id: "53" },
322        { name: "Kour Green Soldier", id: "54" },
323        { name: "Yellow Astronaut", id: "55" },
324        { name: "Orange Astronaut", id: "56" },
325        { name: "Red Astronaut", id: "57" },
326        { name: "Blue Astronaut", id: "58" },
327        { name: "Kour Banana", id: "59" },
328        { name: "Mrs Kour", id: "60" },
329        { name: "Investor Inverted", id: "61" },
330        { name: "Kour Jungler", id: "62" },
331        { name: "Skinny Baby", id: "63" },
332        { name: "KourTuber", id: "64" },
333        { name: "Red Hologram", id: "65" },
334        { name: "White Hologram", id: "66" },
335        { name: "Orange Hologram", id: "67" },
336        { name: "Dark Blue Hologram", id: "68" },
337        { name: "Brown Hologram", id: "69" },
338        { name: "Yellow Hologram", id: "70" },
339        { name: "Dark Red Hologram", id: "71" },
340        { name: "Kourist", id: "72" },
341        { name: "Firefighter", id: "73" },
342        { name: "FireKour", id: "74" },
343        { name: "Kour Thief", id: "75" },
344        { name: "Kour Burger", id: "76" },
345        { name: "Kour Fan", id: "77" },
346        { name: "Kour Brady", id: "78" },
347        { name: "LeKour James", id: "79" },
348        { name: "Uncle Kour", id: "80" },
349        { name: "Chef", id: "81" },
350        { name: "KourObby", id: "82" },
351        { name: "Legionary", id: "83" },
352        { name: "Kitty Kour One", id: "84" },
353        { name: "Kitty Kour Two", id: "85" },
354        { name: "Kitty Kour Three", id: "86" },
355        { name: "Kour Crafter", id: "87" },
356        { name: "RTX", id: "88" },
357        { name: "Loony Kour", id: "89" },
358        { name: "Kour Shocker", id: "90" },
359        { name: "Kourkin", id: "91" },
360        { name: "Forest Kour", id: "92" },
361        { name: "Slender Kour", id: "93" },
362        { name: "Drakour", id: "94" },
363        { name: "Christmas2024", id: "95" },
364        { name: "Deer2024", id: "96" }
365    ];
366
367    function setSkin(skinID) {
368        firebase
369            .database()
370            .ref("users/" + firebase.auth().currentUser.uid)
371            .child("skin")
372            .set(skinID);
373        showUserDetails(
374            firebase.auth().currentUser.email,
375            firebase.auth().currentUser
376        );
377    }
378
379    /***************************************
380   * Profile Stats
381   ***************************************/
382    function setStat(stat, value) {
383        const parsedValue = parseInt(value, 10);
384        const finalValue = isNaN(parsedValue) ? value : parsedValue;
385        firebase
386            .database()
387            .ref("users/" + firebase.auth().currentUser.uid + "/public")
388            .child(stat)
389            .set(finalValue);
390        showUserDetails(
391            firebase.auth().currentUser.email,
392            firebase.auth().currentUser
393        );
394    }
395
396    /***************************************
397   * Clan Editing
398   ***************************************/
399
400    function overrideCreateClan() {
401        if (typeof createClan === 'function') {
402            createClan = function(clanName, leaderUserId, clanColor, reqID) {
403                unityInstanceWrapper.sendMessage(firebaseObjName, 'OnSetDataNew', clanName + "&" + reqID);
404            };
405            //console.log("override done.");
406        } else {
407            setTimeout(overrideCreateClan, 500);
408        }
409    }
410
411    overrideCreateClan();
412
413    /***************************************
414   * Class Kills
415   ***************************************/
416    const classMap = {
417        Soldier: "class0kills",
418        Hitman: "class1kills",
419        Gunner: "class2kills",
420        Heavy: "class3kills",
421        Rocketeer: "class4kills",
422        Agent: "class5kills",
423        Brawler: "class6kills",
424        Investor: "class7kills",
425        Assassin: "class8kills",
426        Juggernaut: "class9kills",
427        Recon: "class10kills",
428        Pyro: "class11kills",
429        Rayblader: "class15kills",
430    };
431
432    function setClassKills() {
433        const existingDialog = document.getElementById("classSelectionDialog");
434        if (existingDialog) existingDialog.remove();
435
436        const classSelectionDialog = document.createElement("div");
437        classSelectionDialog.id = "classSelectionDialog";
438        Object.assign(classSelectionDialog.style, {
439            position: "fixed",
440            top: "50%",
441            left: "50%",
442            transform: "translate(-50%, -50%)",
443            backgroundColor: "#5a2d72",
444            color: "#fff",
445            padding: "20px",
446            zIndex: "10002",
447            fontFamily: "Arial, sans-serif",
448            fontSize: "14px",
449            borderRadius: "8px",
450            boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
451            width: "300px",
452            maxHeight: "400px",
453            overflowY: "auto",
454            cursor: "move",
455            userSelect: "none",
456        });
457
458        const closeBtn = document.createElement("button");
459        closeBtn.textContent = "×";
460        closeBtn.style.position = "absolute";
461        closeBtn.style.top = "5px";
462        closeBtn.style.right = "5px";
463        closeBtn.style.background = "none";
464        closeBtn.style.border = "none";
465        closeBtn.style.color = "#fff";
466        closeBtn.style.fontSize = "16px";
467        closeBtn.style.cursor = "pointer";
468        closeBtn.addEventListener("click", () => classSelectionDialog.remove());
469        classSelectionDialog.appendChild(closeBtn);
470
471        const dialogTitle = document.createElement("div");
472        dialogTitle.textContent = "Select Class";
473        dialogTitle.style.fontWeight = "bold";
474        dialogTitle.style.fontSize = "18px";
475        dialogTitle.style.marginBottom = "15px";
476        dialogTitle.style.textAlign = "center";
477        classSelectionDialog.appendChild(dialogTitle);
478
479        const classButtonContainer = document.createElement("div");
480        classButtonContainer.style.display = "grid";
481        classButtonContainer.style.gridTemplateColumns = "repeat(2, 1fr)";
482        classButtonContainer.style.gap = "8px";
483
484        Object.keys(classMap).forEach((className) => {
485            const classBtn = document.createElement("button");
486            classBtn.textContent = className;
487            Object.assign(classBtn.style, {
488                padding: "8px",
489                cursor: "pointer",
490                backgroundColor: "#9b3e9f",
491                border: "none",
492                borderRadius: "5px",
493                fontSize: "13px",
494                color: "#fff",
495                transition: "background-color 0.3s",
496            });
497
498            classBtn.addEventListener(
499                "mouseover",
500                () => (classBtn.style.backgroundColor = "#a74cbf")
501            );
502            classBtn.addEventListener(
503                "mouseout",
504                () => (classBtn.style.backgroundColor = "#9b3e9f")
505            );
506
507            classBtn.addEventListener("click", () => {
508                const killsValue = prompt(
509                    `Enter kill count for ${className}:`,
510                    "10000"
511                );
512                if (killsValue === null) return;
513
514                const numKills = Number(killsValue);
515                if (isNaN(numKills)) {
516                    alert("Please enter a valid number!");
517                    return;
518                }
519
520                const dbField = classMap[className];
521                updateClassKills(dbField, numKills);
522                classSelectionDialog.remove();
523            });
524
525            classButtonContainer.appendChild(classBtn);
526        });
527
528        classSelectionDialog.appendChild(classButtonContainer);
529
530        const cancelBtn = document.createElement("button");
531        cancelBtn.textContent = "Cancel";
532        Object.assign(cancelBtn.style, {
533            width: "100%",
534            marginTop: "15px",
535            padding: "8px",
536            cursor: "pointer",
537            backgroundColor: "#444",
538            border: "none",
539            borderRadius: "5px",
540            color: "#fff",
541        });
542        cancelBtn.addEventListener("click", () => classSelectionDialog.remove());
543        classSelectionDialog.appendChild(cancelBtn);
544
545        let pos1 = 0,
546            pos2 = 0,
547            pos3 = 0,
548            pos4 = 0;
549        classSelectionDialog.onmousedown = dragMouseDown;
550
551        function dragMouseDown(e) {
552            if (e.target.tagName === "BUTTON" || e.target.tagName === "INPUT") {
553                return;
554            }
555
556            e = e || window.event;
557            e.preventDefault();
558            pos3 = e.clientX;
559            pos4 = e.clientY;
560            document.onmouseup = closeDragElement;
561            document.onmousemove = elementDrag;
562        }
563
564        function elementDrag(e) {
565            e = e || window.event;
566            e.preventDefault();
567            pos1 = pos3 - e.clientX;
568            pos2 = pos4 - e.clientY;
569            pos3 = e.clientX;
570            pos4 = e.clientY;
571            classSelectionDialog.style.top =
572                classSelectionDialog.offsetTop - pos2 + "px";
573            classSelectionDialog.style.left =
574                classSelectionDialog.offsetLeft - pos1 + "px";
575            classSelectionDialog.style.transform = "none";
576        }
577
578        function closeDragElement() {
579            document.onmouseup = null;
580            document.onmousemove = null;
581        }
582
583        document.body.appendChild(classSelectionDialog);
584    }
585
586    function updateClassKills(classField, killCount) {
587        if (!firebase.auth().currentUser) {
588            console.log("[Zeph Menu] User is not logged in");
589            return;
590        }
591
592        const updateData = {};
593        updateData[classField] = killCount;
594
595        firebase
596            .database()
597            .ref(`users/${firebase.auth().currentUser.uid}`)
598            .update(updateData)
599            .then(() => {
600            showUserDetails(
601                firebase.auth().currentUser.email,
602                firebase.auth().currentUser
603            );
604            console.log(
605                `[Zeph Menu] ${classField} successfully updated to ${killCount}`
606        );
607            showUserDetails(
608                firebase.auth().currentUser.email,
609                firebase.auth().currentUser
610            );
611        })
612            .catch((err) => {
613            console.error(`[Zeph Menu] Failed to update ${classField}:`, err);
614        });
615    }
616
617    /***************************************
618   * Stats Changer
619   ***************************************/
620    function updateKDStats(kills) {
621        if (!firebase.auth().currentUser) {
622            console.log("[Zeph Menu] User is not logged in");
623            alert("login first!");
624            return;
625        }
626
627        const updateData = {
628            totalKills: kills,
629        };
630
631        firebase
632            .database()
633            .ref(`users/${firebase.auth().currentUser.uid}`)
634            .update(updateData)
635            .then(() => {
636            showUserDetails(
637                firebase.auth().currentUser.email,
638                firebase.auth().currentUser
639            );
640            console.log(
641                `[Zeph Menu] Stats updated to Kills:${kills}`
642        );
643        })
644            .catch((err) => {
645            console.error("[Zeph Menu] Failed to update stats:", err);
646        });
647    }
648
649    function setKDStats() {
650        const kills = prompt("Enter new Total Kills:", "1337");
651        if (kills === null) return;
652        const parsedKills = Number(kills);
653
654        if (isNaN(parsedKills)) {
655            alert("Please enter valid numbers for kills.");
656            return;
657        }
658
659        updateKDStats(parsedKills);
660    }
661
662
663    /***************************************
664   * Air strafing
665   ***************************************/
666
667    let spaceHeld = false;
668    let turningLeft = false;
669    let turningRight = false;
670
671    let lastMoveTime = 0;
672    const activeTimeout = 150;
673
674    document.addEventListener('mousemove', e => {
675        if (e.movementX < 0) {
676            turningLeft = true;
677            turningRight = false;
678        } else if (e.movementX > 0) {
679            turningRight = true;
680            turningLeft = false;
681        }
682        lastMoveTime = Date.now();
683    });
684
685    document.addEventListener('keydown', e => {
686        if (e.code === 'Space') spaceHeld = true;
687    });
688
689    document.addEventListener('keyup', e => {
690        if (e.code === 'Space') spaceHeld = false;
691    });
692
693    function simulateKey(code, down = true) {
694        const event = new KeyboardEvent(down ? 'keydown' : 'keyup', {
695            code: code,
696            key: code.replace('Key', ''),
697            keyCode: code === 'KeyA' ? 65 : 68,
698            which: code === 'KeyA' ? 65 : 68,
699            bubbles: true,
700            cancelable: true,
701        });
702        document.dispatchEvent(event);
703    }
704
705    let aHeld = false;
706    let dHeld = false;
707
708    function loop() {
709        const now = Date.now();
710        const mouseActive = (now - lastMoveTime) < activeTimeout;
711        if (kourInstance.config.airStrafing){
712            if (spaceHeld && mouseActive) {
713                if (turningLeft && !aHeld) {
714                    simulateKey('KeyA', true);
715                    aHeld = true;
716                } else if (!turningLeft && aHeld) {
717                    simulateKey('KeyA', false);
718                    aHeld = false;
719                }
720
721                if (turningRight && !dHeld) {
722                    simulateKey('KeyD', true);
723                    dHeld = true;
724                } else if (!turningRight && dHeld) {
725                    simulateKey('KeyD', false);
726                    dHeld = false;
727                }
728            } else {
729                if (aHeld) {
730                    simulateKey('KeyA', false);
731                    aHeld = false;
732                }
733                if (dHeld) {
734                    simulateKey('KeyD', false);
735                    dHeld = false;
736                }
737            }
738
739            requestAnimationFrame(loop);
740        }
741    }
742
743    loop();
744
745    /***************************************
746   * ESP
747   ***************************************/
748
749    let gl = null;
750    const filters = [
751        { min: 1481, max: 1483 }, // normal
752        { min: 1553, max: 1555 }, // princess
753        { min: 5615, max: 5617 }, // RTX
754        { min: 3875, max: 3877 }, // Egg
755        //{ min: 239, max: 240},      // Map Secret
756    ];
757
758    window.espEnabled = true;
759
760    window.addEventListener("keydown", (e) => {
761        if (e.key.toLowerCase() === "p") {
762            window.espEnabled = !window.espEnabled;
763            const espCheckbox = document.getElementById("espToggle");
764            if (espCheckbox) espCheckbox.checked = window.espEnabled;
765            console.log(`[Zeph ESP] Toggled ${window.espEnabled ? "ON" : "OFF"}`);
766        }
767    });
768
769    const WebGL = WebGL2RenderingContext.prototype;
770
771    HTMLCanvasElement.prototype.getContext = new Proxy(
772        HTMLCanvasElement.prototype.getContext,
773        {
774            apply(target, thisArgs, args) {
775                if (args[1]) {
776                    args[1].preserveDrawingBuffer = true;
777                }
778                return Reflect.apply(...arguments);
779            },
780        }
781    );
782
783    try {
784        window.espColor = JSON.parse(localStorage.getItem("espColorRGB")) || { r: 0, g: 0, b: 0 };
785    } catch {
786        window.espColor = { r: 0, g: 0, b: 0 };
787    }
788
789    const drawHandler = {
790        apply(target, thisArgs, args) {
791            const count = args[1];
792            const blockarms = document.getElementById("blockarms");
793            if (count === 300 && settings.crosshairEnabled) {
794                return;
795            }
796            if (count === 24 && settings.damagenumbersoff) {
797                return;
798            }
799            if (blockarms && blockarms.checked && count === 1098) {
800                return;
801            }
802            const program = thisArgs.getParameter(thisArgs.CURRENT_PROGRAM);
803            if (!program.uniforms) {
804                program.uniforms = {
805                    vertexCount: thisArgs.getUniformLocation(program, "vertexCount"),
806                    espToggle: thisArgs.getUniformLocation(program, "espToggle"),
807                    gnilgnim: thisArgs.getUniformLocation(program, "gnilgnim"),
808                    espColor: thisArgs.getUniformLocation(program, "espColor"),
809                };
810            }
811
812            if (program.uniforms.vertexCount) {
813                thisArgs.uniform1f(program.uniforms.vertexCount, count);
814            }
815            if (program.uniforms.espToggle) {
816                thisArgs.uniform1f(program.uniforms.espToggle, window.espEnabled ? 1.0 : 0.0);
817            }
818            if (program.uniforms.gnilgnim) {
819                thisArgs.uniform1f(program.uniforms.gnilgnim, 13371337.0);
820            }
821            if (program.uniforms.espColor && window.espColor) {
822                const { r, g, b } = window.espColor;
823                thisArgs.uniform3f(program.uniforms.espColor, r / 255, g / 255, b / 255);
824            }
825
826            gl = thisArgs;
827            return Reflect.apply(...arguments);
828        },
829    };
830
831    WebGL.drawElements = new Proxy(WebGL.drawElements, drawHandler);
832    WebGL.drawElementsInstanced = new Proxy(WebGL.drawElementsInstanced, drawHandler);
833
834    function generateRangeConditions(varName) {
835        return filters
836            .map(({ min, max }) => `(${varName} >= ${min}.0 && ${varName} <= ${max}.0)`)
837            .join(" || ");
838    }
839
840    WebGL.shaderSource = new Proxy(WebGL.shaderSource, {
841        apply(target, thisArgs, args) {
842            let [shader, src] = args;
843
844            if (src.includes("gl_Position")) {
845                const conditions = generateRangeConditions("vertexCount");
846                src = src.replace(
847                    /void\s+main\s*\(\s*\)\s*\{/,
848                    `uniform float vertexCount;\nuniform float espToggle;\nuniform float gnilgnim;\nout float vVertexCount;\nuniform vec3 espColor;\nvoid main() {\nvVertexCount = vertexCount;\n`
849            );
850                src = src.replace(
851                    /(gl_Position\s*=.+;)/,
852                    `$1\nif (espToggle > 0.5 && (${conditions})) {\n  gl_Position.z = 0.01 + gl_Position.z * 0.1;\n}\nif (espToggle > 0.5 && gnilgnim == 13371337.0) {\n  gl_Position.z *= 1.0;\n}`
853            );
854            }
855
856            if (src.includes("SV_Target0")) {
857                const conditions = generateRangeConditions("vVertexCount");
858                src = src
859                    .replace(
860                    /void\s+main\s*\(\s*\)\s*\{/,
861                    `uniform float espToggle;\nuniform float gnilgnim;\nin float vVertexCount;\nuniform vec3 espColor;\nvoid main() {`
862                )
863                    .replace(
864                    /return;/,
865                    `if (espToggle > 0.5 && (${conditions}) && SV_Target0.a > 0.5) {\n  SV_Target0 = vec4(espColor, 1.0);\n}\nif (gnilgnim == 13371337.0) {\n  SV_Target0.rgb *= 1.0;\n}\nreturn;`
866                );
867            }
868
869            args[1] = src;
870            return Reflect.apply(...arguments);
871        },
872    });
873
874    /***************************************
875   * Color Aimbot
876   ***************************************/
877
878    let fovCircleEnabled = true;
879
880    const fovCanvas = document.createElement('canvas');
881    fovCanvas.style.position = 'fixed';
882    fovCanvas.style.top = '0';
883    fovCanvas.style.left = '0';
884    fovCanvas.style.pointerEvents = 'none';
885    fovCanvas.style.zIndex = '9999';
886    document.body.appendChild(fovCanvas);
887
888    const fovCtx = fovCanvas.getContext('2d');
889
890    function resizeCanvas() {
891        fovCanvas.width = window.innerWidth;
892        fovCanvas.height = window.innerHeight;
893    }
894    resizeCanvas();
895    window.addEventListener('resize', resizeCanvas);
896
897    const fovRadius = 80;
898
899    function drawFOVCircle() {
900        fovCtx.clearRect(0, 0, fovCanvas.width, fovCanvas.height);
901        if (!fovCircleEnabled) return;
902        const centerX = fovCanvas.width / 2;
903        const centerY = fovCanvas.height / 2;
904
905        fovCtx.beginPath();
906        fovCtx.arc(centerX, centerY, fovRadius, 0, Math.PI * 2);
907        fovCtx.strokeStyle = 'rgba(0, 255, 0, 0.6)';
908        fovCtx.lineWidth = 2;
909        fovCtx.stroke();
910    }
911
912    const settings = {
913        aimbotEnabled: true,
914        aimbotSpeed: 1.2,
915        aimbotTriggerButton: ['left', 'right'],
916        crosshairEnabled: false,
917        triggerbotEnabled: true,
918        damagenumbersoff: false,
919    };
920
921    let mouseButtons = { left: false, right: false};
922
923    document.addEventListener("mousedown", (e) => {
924        if (e.button === 0) mouseButtons.left = true;
925        if (e.button === 2) mouseButtons.right = true;
926    });
927    document.addEventListener("mouseup", (e) => {
928        if (e.button === 0) mouseButtons.left = false;
929        if (e.button === 2) mouseButtons.right = false;
930    });
931
932    function isTriggerPressed() {
933        return settings.aimbotTriggerButton.some(btn => mouseButtons[btn]);
934    }
935
936    function isTargetPixel(r, g, b, a, t, c) {
937        if (a === 0) return false;
938
939        const dr = r - c.r;
940        const dg = g - c.g;
941        const db = b - c.b;
942
943        return (dr * dr + dg * dg + db * db) <= (t * t);
944    }
945
946    function updateAimbot() {
947        drawFOVCircle();
948        if (!settings.aimbotEnabled || !gl || !gl.canvas || !gl.readPixels || !isTriggerPressed()) return;
949
950        const width = Math.min(150, gl.canvas?.width || 0);
951        const height = Math.min(150, gl.canvas?.height || 0);
952        if (width < 10 || height < 10) {
953            return;
954        }
955        const t = 20;
956        const c = window.espColor;
957
958        const centerX = gl.canvas.width / 2;
959        const centerY = gl.canvas.height / 2;
960        const startX = Math.floor(centerX - width / 2);
961        const startY = Math.floor(centerY - height / 2);
962        const pixels = new Uint8Array(width * height * 4);
963
964        gl.readPixels(startX, startY, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
965
966        let closestDist = Infinity;
967        let bestDX = 0;
968        let bestDY = 0;
969        let targetCount = 0;
970        //console.log(window.espColor);
971        for (let i = 0; i < pixels.length; i += 4) {
972            const r = pixels[i], g = pixels[i + 1], b = pixels[i + 2], a = pixels[i + 3];
973            if (isTargetPixel(r, g, b, a, t, c)) {
974                targetCount++;
975                const index = i / 4;
976                const x = index % width;
977                const y = Math.floor(index / width);
978                const dx = startX + x - centerX;
979                const dy = -(startY + y - centerY);
980                const dist = Math.hypot(dx, dy);
981                if (fovCircleEnabled) {
982                    if (dist > fovRadius) continue;
983                }
984                const gnilgnim = "signature Start X - Y";
985                if (dist < closestDist) {
986                    closestDist = dist;
987                    bestDX = dx;
988                    bestDY = dy;
989                }
990            }
991        }
992
993        if (closestDist < Infinity) {
994            //console.log("moving");
995            const factor = settings.aimbotSpeed;
996            gl.canvas.dispatchEvent(new MouseEvent("mousemove", {
997                movementX: bestDX * factor,
998                movementY: bestDY * factor,
999                bubbles: true,
1000                cancelable: true,
1001                composed: true,
1002            }));
1003        }
1004    }
1005
1006    setInterval(updateAimbot, 0);
1007
1008
1009    function createUI() {
1010        const menu = document.createElement("div");
1011        menu.id = "zephMenu";
1012        Object.assign(menu.style, {
1013            position: "fixed",
1014            top: "50px",
1015            right: "50px",
1016            width: "250px",
1017            maxHeight: "600px",
1018            overflowY: "auto",
1019            backgroundColor: "#5a2d72",
1020            color: "#fff",
1021            padding: "15px",
1022            zIndex: "10000",
1023            fontFamily: "Arial, sans-serif",
1024            fontSize: "16px",
1025            borderRadius: "8px",
1026            boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
1027            display: "none",
1028            transition: "all 0.3s ease-in-out",
1029        });
1030
1031        const secondaryWeaponMenu = createWeaponMenu("Secondary Weapon", false);
1032        const meleeWeaponMenu = createWeaponMenu("Melee Weapon", true);
1033        const skinMenu = createSkinMenu();
1034
1035        const profileModderMenu = document.createElement("div");
1036        profileModderMenu.id = "zephProfileModderMenu";
1037        Object.assign(profileModderMenu.style, {
1038            position: "fixed",
1039            top: "50px",
1040            right: "320px",
1041            width: "220px",
1042            backgroundColor: "#5a2d72",
1043            color: "#fff",
1044            padding: "15px",
1045            zIndex: "10000",
1046            fontFamily: "Arial, sans-serif",
1047            fontSize: "14px",
1048            borderRadius: "8px",
1049            boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
1050            display: "none",
1051            transition: "all 0.3s ease-in-out",
1052        });
1053
1054        const profileHeader = document.createElement("div");
1055        profileHeader.textContent = "Profile Modder";
1056        profileHeader.style.textAlign = "center";
1057        profileHeader.style.fontWeight = "bold";
1058        profileHeader.style.marginBottom = "10px";
1059        profileModderMenu.appendChild(profileHeader);
1060
1061        const buttonContainer = document.createElement("div");
1062        Object.assign(buttonContainer.style, {
1063            maxHeight: "400px",
1064            overflowY: "auto",
1065        });
1066        profileModderMenu.appendChild(buttonContainer);
1067
1068        function createStyledButton(text, onClick) {
1069            const btn = document.createElement("button");
1070            btn.textContent = text;
1071            Object.assign(btn.style, {
1072                width: "100%",
1073                margin: "5px 0",
1074                padding: "8px",
1075                cursor: "pointer",
1076                backgroundColor: "#9b3e9f",
1077                border: "none",
1078                borderRadius: "5px",
1079                fontSize: "14px",
1080                color: "#fff",
1081                transition: "background-color 0.3s",
1082            });
1083            btn.addEventListener("click", onClick);
1084            btn.addEventListener("mouseover", () => (btn.style.backgroundColor = "#a74cbf"));
1085            btn.addEventListener("mouseout", () => (btn.style.backgroundColor = "#9b3e9f"));
1086            buttonContainer.appendChild(btn);
1087        }
1088
1089        createStyledButton("Set Class Kills", setClassKills);
1090        createStyledButton("Change Kills", setKDStats);
1091
1092        const statMappings = [
1093            { label: "ELO", key: "elo" },
1094            { label: "Chickalettas Killed", key: "chickalettasKilled" },
1095            //{ label: "Deaths", key: "totalDeaths" }, // dont we wish LOL
1096            { label: "Games Played", key: "gamesPlayed" },
1097            { label: "Games Won", key: "gamesWon" },
1098            //{ label: "Games Lost", key: "gamesLost" },  //could be possible i just cant lose a game LOL
1099            { label: "Knife Kills", key: "knifeKills" },
1100            { label: "Assists", key: "assists" },
1101            { label: "Highest Kill Streak", key: "maxKillStreak" },
1102            { label: "Barrels Shot", key: "barrels" },
1103            { label: "Kyles Killed", key: "kylesKilled" },
1104        ];
1105
1106        function createStatButton(label, key) {
1107            createStyledButton(`Change ${label}`, () => {
1108                const newValue = prompt(`Enter new value for ${label}:`);
1109                if (newValue !== null) {
1110                    setStat(key, newValue);
1111                }
1112            });
1113        }
1114
1115        statMappings.forEach(({ label, key }) => {
1116            createStatButton(label, key);
1117        });
1118
1119        const headerContainer = document.createElement("div");
1120        headerContainer.style.marginBottom = "15px";
1121        headerContainer.style.position = "relative";
1122
1123        const madeByText = document.createElement("div");
1124        madeByText.textContent = "Made by: Happyjeffery, Rasperiiii, suppress";
1125        madeByText.style.fontSize = "10px";
1126        madeByText.style.textAlign = "center";
1127        madeByText.style.marginBottom = "5px";
1128        madeByText.style.fontWeight = "bold";
1129        madeByText.style.letterSpacing = "0.5px";
1130
1131        let hue = 0;
1132        function updateRGB() {
1133            hue = (hue + 1) % 360;
1134            madeByText.style.color = `hsl(${hue}, 100%, 70%)`;
1135            requestAnimationFrame(updateRGB);
1136        }
1137        updateRGB();
1138
1139        headerContainer.appendChild(madeByText);
1140
1141        const titleContainer = document.createElement("div");
1142        titleContainer.style.display = "flex";
1143        titleContainer.style.alignItems = "center";
1144        titleContainer.style.justifyContent = "center";
1145        titleContainer.style.gap = "8px";
1146
1147        const header = document.createElement("div");
1148        header.textContent = "Zeph Menu";
1149        header.style.fontWeight = "bold";
1150        header.style.fontSize = "20px";
1151
1152        const discordLogo = document.createElement("img");
1153        discordLogo.src = "https://i.ibb.co/sJV6y56H/Zeph-Menu-Discordlogo.png";
1154        discordLogo.alt = "Discord Logo";
1155        discordLogo.style.width = "22px";
1156        discordLogo.style.height = "22px";
1157        discordLogo.style.cursor = "pointer";
1158        discordLogo.style.transition = "all 0.2s ease";
1159        discordLogo.style.borderRadius = "4px";
1160        discordLogo.addEventListener("click", () => window.open("https://discord.gg/3XCAwXdRUh", "_blank"));
1161        discordLogo.addEventListener("mouseover", () => {
1162            discordLogo.style.transform = "scale(1.1) rotate(2deg)";
1163            discordLogo.style.filter = "brightness(1.2) drop-shadow(0 0 2px rgba(255,255,255,0.3))";
1164        });
1165        discordLogo.addEventListener("mouseout", () => {
1166            discordLogo.style.transform = "scale(1) rotate(0deg)";
1167            discordLogo.style.filter = "none";
1168        });
1169
1170        titleContainer.appendChild(header);
1171        titleContainer.appendChild(discordLogo);
1172        headerContainer.appendChild(titleContainer);
1173        menu.appendChild(headerContainer);
1174
1175        const profileModderBtn = document.createElement("button");
1176        profileModderBtn.textContent = "Profile Modder";
1177        Object.assign(profileModderBtn.style, {
1178            width: "100%",
1179            margin: "8px 0",
1180            padding: "8px",
1181            cursor: "pointer",
1182            backgroundColor: "#9b3e9f",
1183            border: "none",
1184            borderRadius: "5px",
1185            fontSize: "14px",
1186            color: "#fff",
1187            transition: "background-color 0.3s",
1188        });
1189        profileModderBtn.addEventListener("click", () => {
1190            profileModderMenu.style.display = profileModderMenu.style.display === "none" ? "block" : "none";
1191            secondaryWeaponMenu.style.display = "none";
1192            meleeWeaponMenu.style.display = "none";
1193            skinMenu.style.display = "none";
1194        });
1195        profileModderBtn.addEventListener("mouseover", () => (profileModderBtn.style.backgroundColor = "#a74cbf"));
1196        profileModderBtn.addEventListener("mouseout", () => (profileModderBtn.style.backgroundColor = "#9b3e9f"));
1197        menu.appendChild(profileModderBtn);
1198
1199        const secondaryWeaponBtn = document.createElement("button");
1200        secondaryWeaponBtn.textContent = "Set Secondary Weapon";
1201        Object.assign(secondaryWeaponBtn.style, {
1202            width: "100%",
1203            margin: "8px 0",
1204            padding: "8px",
1205            cursor: "pointer",
1206            backgroundColor: "#53277E",
1207            border: "none",
1208            borderRadius: "5px",
1209            fontSize: "14px",
1210            color: "#fff",
1211            transition: "background-color 0.3s",
1212        });
1213        secondaryWeaponBtn.addEventListener("click", () => {
1214            secondaryWeaponMenu.style.display = secondaryWeaponMenu.style.display === "none" ? "block" : "none";
1215            meleeWeaponMenu.style.display = "none";
1216            profileModderMenu.style.display = "none";
1217            skinMenu.style.display = "none";
1218        });
1219        secondaryWeaponBtn.addEventListener("mouseover", () => (secondaryWeaponBtn.style.backgroundColor = "#6a359c"));
1220        secondaryWeaponBtn.addEventListener("mouseout", () => (secondaryWeaponBtn.style.backgroundColor = "#53277E"));
1221        menu.appendChild(secondaryWeaponBtn);
1222
1223        const meleeWeaponBtn = document.createElement("button");
1224        meleeWeaponBtn.textContent = "Set Melee Weapon";
1225        Object.assign(meleeWeaponBtn.style, {
1226            width: "100%",
1227            margin: "8px 0",
1228            padding: "8px",
1229            cursor: "pointer",
1230            backgroundColor: "#53277E",
1231            border: "none",
1232            borderRadius: "5px",
1233            fontSize: "14px",
1234            color: "#fff",
1235            transition: "background-color 0.3s",
1236        });
1237        meleeWeaponBtn.addEventListener("click", () => {
1238            meleeWeaponMenu.style.display = meleeWeaponMenu.style.display === "none" ? "block" : "none";
1239            secondaryWeaponMenu.style.display = "none";
1240            profileModderMenu.style.display = "none";
1241        });
1242        meleeWeaponBtn.addEventListener("mouseover", () => (meleeWeaponBtn.style.backgroundColor = "#6a359c"));
1243        meleeWeaponBtn.addEventListener("mouseout", () => (meleeWeaponBtn.style.backgroundColor = "#53277E"));
1244        menu.appendChild(meleeWeaponBtn);
1245
1246        const skinBtn = document.createElement("button");
1247        skinBtn.textContent = "Set Skin";
1248        Object.assign(skinBtn.style, {
1249            width: "100%",
1250            margin: "8px 0",
1251            padding: "8px",
1252            cursor: "pointer",
1253            backgroundColor: "#53277E",
1254            border: "none",
1255            borderRadius: "5px",
1256            fontSize: "14px",
1257            color: "#fff",
1258            transition: "background-color 0.3s",
1259        });
1260        skinBtn.addEventListener("click", () => {
1261            meleeWeaponMenu.style.display = "none";
1262            secondaryWeaponMenu.style.display = "none";
1263            profileModderMenu.style.display = "none";
1264            skinMenu.style.display = skinMenu.style.display === "none" ? "block" : "none";
1265        });
1266        skinBtn.addEventListener("mouseover", () => (skinBtn.style.backgroundColor = "#6a359c"));
1267        skinBtn.addEventListener("mouseout", () => (skinBtn.style.backgroundColor = "#53277E"));
1268        menu.appendChild(skinBtn);
1269
1270        const speedContainer = document.createElement("div");
1271        speedContainer.style.margin = "15px 0";
1272        const speedLabel = document.createElement("label");
1273        speedLabel.textContent = "Speed Hack Multiplier: ";
1274        speedContainer.appendChild(speedLabel);
1275        const speedValue = document.createElement("span");
1276        speedValue.textContent = "1x";
1277        speedContainer.appendChild(speedValue);
1278        const speedSlider = document.createElement("input");
1279        speedSlider.type = "range";
1280        speedSlider.min = "1";
1281        speedSlider.max = "6";
1282        speedSlider.step = "0.5";
1283        speedSlider.value = "1";
1284        speedSlider.style.width = "100%";
1285        speedSlider.addEventListener("input", function() {
1286            let multiplier = parseFloat(speedSlider.value);
1287            speedValue.textContent = multiplier.toFixed(1) + "x";
1288            updatePerformanceNow(multiplier);
1289        });
1290        speedContainer.appendChild(speedSlider);
1291        menu.appendChild(speedContainer);
1292
1293        const airContainer = document.createElement("div");
1294        const airCheckbox = document.createElement("input");
1295        airCheckbox.type = "checkbox";
1296        airCheckbox.id = "airToggle";
1297        airCheckbox.checked = kourInstance.config.airStrafing;
1298        airCheckbox.addEventListener("change", function() {
1299            kourInstance.config.airStrafing = this.checked;
1300        });
1301        const airLabel = document.createElement("label");
1302        airLabel.htmlFor = "airToggle";
1303        airLabel.textContent = " Air Strafing";
1304        airContainer.appendChild(airCheckbox);
1305        airContainer.appendChild(airLabel);
1306        menu.appendChild(airContainer);
1307
1308        const aimContainer = document.createElement("div");
1309        const aimCheckbox = document.createElement("input");
1310        aimCheckbox.type = "checkbox";
1311        aimCheckbox.id = "aimToggle";
1312        aimCheckbox.checked = kourInstance.config.AntiAim;
1313        aimCheckbox.addEventListener("change", function() {
1314            kourInstance.config.AntiAim = this.checked;
1315        });
1316        const aimLabel = document.createElement("label");
1317        aimLabel.htmlFor = "aimToggle";
1318        aimLabel.textContent = " AntiPlayer (Turn off invis in lobby)";
1319        aimContainer.appendChild(aimCheckbox);
1320        aimContainer.appendChild(aimLabel);
1321        menu.appendChild(aimContainer);
1322
1323        const invisContainer = document.createElement("div");
1324        const invisCheckbox = document.createElement("input");
1325        invisCheckbox.type = "checkbox";
1326        invisCheckbox.id = "invisToggle";
1327        invisCheckbox.checked = kourInstance.config.Invisible;
1328        invisCheckbox.addEventListener("change", function() {
1329            kourInstance.config.Invisible = this.checked;
1330            console.log("Invisibility set to " + this.checked);
1331        });
1332        const invisLabel = document.createElement("label");
1333        invisLabel.htmlFor = "invisToggle";
1334        invisLabel.textContent = " Invisible";
1335        invisContainer.appendChild(invisCheckbox);
1336        invisContainer.appendChild(invisLabel);
1337        menu.appendChild(invisContainer);
1338
1339        const blockarmsContainer = document.createElement("div");
1340        const blockarmsCheckbox = document.createElement("input");
1341        blockarmsCheckbox.type = "checkbox";
1342        blockarmsCheckbox.id = "blockarms";
1343        blockarmsCheckbox.checked = true;
1344
1345        const blockarmsLabel = document.createElement("label");
1346        blockarmsLabel.htmlFor = "blockarms";
1347        blockarmsLabel.textContent = " Hide Arms";
1348        blockarmsContainer.appendChild(blockarmsCheckbox);
1349        blockarmsContainer.appendChild(blockarmsLabel);
1350        menu.appendChild(blockarmsContainer);
1351
1352        function hexToRgb(hex) {
1353            const bigint = parseInt(hex.slice(1), 16);
1354            return {
1355                r: (bigint >> 16) & 255,
1356                g: (bigint >> 8) & 255,
1357                b: bigint & 255
1358            };
1359        }
1360
1361        const espContainer = document.createElement("div");
1362        const espCheckbox = document.createElement("input");
1363        espCheckbox.type = "checkbox";
1364        espCheckbox.id = "espToggle";
1365        espCheckbox.checked = window.espEnabled || false;
1366        espCheckbox.addEventListener("change", function() {
1367            window.espEnabled = this.checked;
1368            console.log("[Zeph ESP] Toggled " + (this.checked ? "ON" : "OFF"));
1369        });
1370
1371        const espColorContainer = document.createElement("div");
1372        espColorContainer.style.marginTop = "8px";
1373        espColorContainer.style.display = "flex";
1374        espColorContainer.style.alignItems = "center";
1375        espColorContainer.style.gap = "8px";
1376
1377        const espColorLabel = document.createElement("label");
1378        espColorLabel.htmlFor = "espColorPicker";
1379        espColorLabel.textContent = "ESP Color:";
1380        espColorLabel.style.flexShrink = "0";
1381
1382        let savedRgb = localStorage.getItem("espColorRGB");
1383        if (savedRgb) {
1384            try {
1385                window.espColor = JSON.parse(savedRgb);
1386            } catch {
1387                window.espColor = { r: 0, g: 0, b: 0 };
1388            }
1389        } else {
1390            window.espColor = { r: 0, g: 0, b: 0 };
1391        }
1392
1393        const espColorPicker = document.createElement("input");
1394        espColorPicker.type = "color";
1395        espColorPicker.id = "espColorPicker";
1396        espColorPicker.value = `#${((1 << 24) + (window.espColor.r << 16) + (window.espColor.g << 8) + window.espColor.b).toString(16).slice(1)}`;
1397
1398        espColorPicker.addEventListener("input", (e) => {
1399            const rgb = hexToRgb(e.target.value);
1400            window.espColor = rgb;
1401            localStorage.setItem("espColorRGB", JSON.stringify(rgb));
1402        });
1403
1404        espColorContainer.appendChild(espColorLabel);
1405        espColorContainer.appendChild(espColorPicker);
1406        menu.appendChild(espColorContainer);
1407
1408        const espLabel = document.createElement("label");
1409        espLabel.htmlFor = "espToggle";
1410        espLabel.textContent = " ESP";
1411        espContainer.appendChild(espCheckbox);
1412        espContainer.appendChild(espLabel);
1413        menu.appendChild(espContainer);
1414
1415        const crosshairContainer = document.createElement("div");
1416        const crosshairCheckbox = document.createElement("input");
1417        crosshairCheckbox.type = "checkbox";
1418        crosshairCheckbox.id = "crosshairToggle";
1419        crosshairCheckbox.checked = settings.crosshairEnabled;
1420        crosshairCheckbox.addEventListener("change", function() {
1421            settings.crosshairEnabled = this.checked;
1422        });
1423        const crosshairLabel = document.createElement("label");
1424        crosshairLabel.htmlFor = "crosshairToggle";
1425        crosshairLabel.textContent = " Hide crosshair";
1426        crosshairContainer.appendChild(crosshairCheckbox);
1427        crosshairContainer.appendChild(crosshairLabel);
1428        menu.appendChild(crosshairContainer);
1429
1430        const aimbotContainer = document.createElement("div");
1431        const aimbotCheckbox = document.createElement("input");
1432        aimbotCheckbox.type = "checkbox";
1433        aimbotCheckbox.id = "aimbotToggle";
1434        aimbotCheckbox.checked = settings.aimbotEnabled;
1435        aimbotCheckbox.addEventListener("change", function() {
1436            settings.aimbotEnabled = this.checked;
1437            console.log("aimbot set to " + this.checked);
1438        });
1439        const aimbotLabel = document.createElement("label");
1440        aimbotLabel.htmlFor = "aimbotToggle";
1441        aimbotLabel.textContent = " Aimbot";
1442        aimbotContainer.appendChild(aimbotCheckbox);
1443        aimbotContainer.appendChild(aimbotLabel);
1444        menu.appendChild(aimbotContainer);
1445
1446        const fovContainer = document.createElement("div");
1447        const fovCheckbox = document.createElement("input");
1448        fovCheckbox.type = "checkbox";
1449        fovCheckbox.id = "fovToggle";
1450        fovCheckbox.checked = fovCircleEnabled;
1451        fovCheckbox.addEventListener("change", () => {
1452            fovCircleEnabled = fovCheckbox.checked;
1453        });
1454
1455        const fovLabel = document.createElement("label");
1456        fovLabel.htmlFor = "fovToggle";
1457        fovLabel.textContent = " FOV Circle";
1458        fovContainer.appendChild(fovCheckbox);
1459        fovContainer.appendChild(fovLabel);
1460        menu.appendChild(fovContainer);
1461
1462        const savedName = localStorage.getItem("playerNickname") || "";
1463
1464        const nameButton = document.createElement("button");
1465        nameButton.textContent = "Edit Name";
1466        Object.assign(nameButton.style, {
1467            marginTop: "10px",
1468            padding: "5px 10px",
1469            backgroundColor: "#7b3fa0",
1470            color: "#fff",
1471            border: "none",
1472            borderRadius: "5px",
1473            cursor: "pointer",
1474            display: "block"
1475        });
1476
1477        nameButton.addEventListener("click", () => {
1478            const newName = prompt("Enter your nickname:", savedName);
1479            if (newName !== null && newName.trim() !== "") {
1480                localStorage.setItem("playerNickname", newName.trim());
1481                if (window.location.href.includes("#")) {
1482                    unityInstance.SendMessage("MapScripts", "SetNickname", newName.trim());
1483                }
1484            }
1485        });
1486
1487        menu.appendChild(nameButton);
1488
1489        let savedClass = localStorage.getItem("selectedClass");
1490
1491        const classBtn = document.createElement("button");
1492        classBtn.textContent = "Select Class";
1493        Object.assign(classBtn.style, {
1494            marginTop: "10px",
1495            padding: "5px 10px",
1496            backgroundColor: "#7b3fa0",
1497            color: "#fff",
1498            border: "none",
1499            borderRadius: "5px",
1500            cursor: "pointer"
1501        });
1502
1503        const classDropdown = document.createElement("div");
1504        Object.assign(classDropdown.style, {
1505            display: "none",
1506            marginTop: "10px",
1507            backgroundColor: "#673a91",
1508            padding: "10px",
1509            borderRadius: "8px"
1510        });
1511
1512        const classMap = {
1513            "Soldier": 0,
1514            "Hitman": 1,
1515            "Gunner": 2,
1516            "Heavy": 3,
1517            "Rocketeer": 4,
1518            "Agent": 5,
1519            "Brawler": 6,
1520            "Investor": 7,
1521            "Assassin": 8,
1522            "Juggernaut": 9,
1523            "Recon": 10,
1524            "Pyro": 11,
1525            "Rayblader": 12
1526        };
1527
1528        Object.keys(classMap).forEach(cls => {
1529            const classOption = document.createElement("button");
1530            classOption.textContent = cls;
1531            Object.assign(classOption.style, {
1532                display: "block",
1533                width: "100%",
1534                margin: "5px 0",
1535                padding: "5px",
1536                backgroundColor: "#9b3e9f",
1537                color: "#fff",
1538                border: "none",
1539                borderRadius: "4px",
1540                cursor: "pointer",
1541            });
1542            classOption.addEventListener("click", () => {
1543                const classID = classMap[cls];
1544                localStorage.setItem("selectedClass", classID);
1545                unityInstance.SendMessage("MapScripts", "ChangeClassTo", classID);
1546                classDropdown.style.display = "none";
1547            });
1548            classDropdown.appendChild(classOption);
1549        });
1550
1551        classBtn.addEventListener("click", () => {
1552            classDropdown.style.display = classDropdown.style.display === "none" ? "block" : "none";
1553        });
1554
1555        menu.appendChild(classBtn);
1556        menu.appendChild(classDropdown);
1557
1558        const keybindBtn = document.createElement("button");
1559        keybindBtn.textContent = "Keybind Settings";
1560        Object.assign(keybindBtn.style, {
1561            marginTop: "10px",
1562            padding: "5px 10px",
1563            backgroundColor: "#7b3fa0",
1564            color: "#fff",
1565            border: "none",
1566            borderRadius: "5px",
1567            cursor: "pointer"
1568        });
1569        keybindBtn.addEventListener("click", () => {
1570            keybindMenu.style.display = keybindMenu.style.display === "none" ? "block" : "none";
1571        });
1572
1573        const keybindMenu = document.createElement("div");
1574        Object.assign(keybindMenu.style, {
1575            display: "none",
1576            marginTop: "10px",
1577            padding: "10px",
1578            backgroundColor: "#673a91",
1579            borderRadius: "8px"
1580        });
1581
1582        const toggleLabel = document.createElement("label");
1583        toggleLabel.textContent = "Toggle Menu Key: ";
1584        toggleLabel.style.marginRight = "5px";
1585
1586        const toggleInput = document.createElement("input");
1587        toggleInput.type = "text";
1588        toggleInput.value = keybinds.toggleMenu;
1589        toggleInput.maxLength = 10;
1590        toggleInput.style.width = "60px";
1591
1592        toggleInput.addEventListener("keydown", (e) => {
1593            e.preventDefault(); // Don't type into box
1594            toggleInput.value = e.key;
1595            keybinds.toggleMenu = e.key;
1596            localStorage.setItem("zephKeybinds", JSON.stringify(keybinds));
1597        });
1598
1599        keybindMenu.appendChild(toggleLabel);
1600        keybindMenu.appendChild(toggleInput);
1601        menu.appendChild(keybindBtn);
1602        menu.appendChild(keybindMenu);
1603
1604
1605        const style = document.createElement("style");
1606        style.textContent = `
1607        @keyframes fadeInOut {
1608            0% { opacity: 0; }
1609            10% { opacity: 1; }
1610            90% { opacity: 1; }
1611            100% { opacity: 0; }
1612        }
1613        @keyframes fadeOut {
1614            from { opacity: 1; }
1615            to { opacity: 0; }
1616        }
1617        @keyframes flashRed {
1618            0% { color: #FF3C3C; }
1619            50% { color: #FFFFFF; }
1620            100% { color: #FF3C3C; }
1621        }
1622    `;
1623        document.head.appendChild(style);
1624
1625        document.body.appendChild(menu);
1626        document.body.appendChild(secondaryWeaponMenu);
1627        document.body.appendChild(meleeWeaponMenu);
1628        document.body.appendChild(profileModderMenu);
1629        document.body.appendChild(skinMenu);
1630    }
1631
1632    function createSkinMenu() {
1633        const skinMenu = document.createElement("div");
1634        skinMenu.id = `zephSkinMenu`;
1635        Object.assign(skinMenu.style, {
1636            position: "fixed",
1637            top: "50px",
1638            right: "320px",
1639            width: "250px",
1640            maxHeight: "400px",
1641            overflowY: "auto",
1642            backgroundColor: "#5a2d72",
1643            color: "#fff",
1644            padding: "15px",
1645            zIndex: "10000",
1646            fontFamily: "Arial, sans-serif",
1647            fontSize: "14px",
1648            borderRadius: "8px",
1649            boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
1650            display: "none",
1651            transition: "all 0.3s ease-in-out",
1652        });
1653
1654        const skinHeader = document.createElement("div");
1655        skinHeader.textContent = "Skin";
1656        skinHeader.style.textAlign = "center";
1657        skinHeader.style.fontWeight = "bold";
1658        skinHeader.style.marginBottom = "10px";
1659        skinMenu.appendChild(skinHeader);
1660
1661        skins.forEach((skin) => {
1662            const btn = document.createElement("button");
1663            btn.textContent = `${skin.name} (${skin.id})`;
1664            Object.assign(btn.style, {
1665                width: "100%",
1666                margin: "5px 0",
1667                padding: "5px",
1668                cursor: "pointer",
1669                backgroundColor: "#9b3e9f",
1670                border: "none",
1671                borderRadius: "5px",
1672                fontSize: "12px",
1673                color: "#fff",
1674                transition: "background-color 0.3s",
1675            });
1676            btn.addEventListener("click", () => {
1677                setSkin(skin.id);
1678                skinMenu.style.display = "none";
1679            });
1680            btn.addEventListener(
1681                "mouseover",
1682                () => (btn.style.backgroundColor = "#a74cbf")
1683            );
1684            btn.addEventListener(
1685                "mouseout",
1686                () => (btn.style.backgroundColor = "#9b3e9f")
1687            );
1688            skinMenu.appendChild(btn);
1689        });
1690
1691        return skinMenu;
1692    }
1693
1694    function createWeaponMenu(title, isMelee) {
1695        const weaponMenu = document.createElement("div");
1696        weaponMenu.id = `zeph${isMelee ? "Melee" : "Secondary"}WeaponMenu`;
1697        Object.assign(weaponMenu.style, {
1698            position: "fixed",
1699            top: "50px",
1700            right: "320px",
1701            width: "250px",
1702            maxHeight: "400px",
1703            overflowY: "auto",
1704            backgroundColor: "#5a2d72",
1705            color: "#fff",
1706            padding: "15px",
1707            zIndex: "10000",
1708            fontFamily: "Arial, sans-serif",
1709            fontSize: "14px",
1710            borderRadius: "8px",
1711            boxShadow: "0 4px 8px rgba(0,0,0,0.2)",
1712            display: "none",
1713            transition: "all 0.3s ease-in-out",
1714        });
1715
1716        const weaponHeader = document.createElement("div");
1717        weaponHeader.textContent = title;
1718        weaponHeader.style.textAlign = "center";
1719        weaponHeader.style.fontWeight = "bold";
1720        weaponHeader.style.marginBottom = "10px";
1721        weaponMenu.appendChild(weaponHeader);
1722
1723        weapons.forEach((weapon) => {
1724            const btn = document.createElement("button");
1725            btn.textContent = `${weapon.name} (${weapon.id})`;
1726            Object.assign(btn.style, {
1727                width: "100%",
1728                margin: "5px 0",
1729                padding: "5px",
1730                cursor: "pointer",
1731                backgroundColor: "#9b3e9f",
1732                border: "none",
1733                borderRadius: "5px",
1734                fontSize: "12px",
1735                color: "#fff",
1736                transition: "background-color 0.3s",
1737            });
1738            btn.addEventListener("click", () => {
1739                if (isMelee) {
1740                    setMeleeWeapon(weapon.id);
1741                } else {
1742                    setSecondaryWeapon(weapon.id);
1743                }
1744                weaponMenu.style.display = "none";
1745            });
1746            btn.addEventListener(
1747                "mouseover",
1748                () => (btn.style.backgroundColor = "#a74cbf")
1749            );
1750            btn.addEventListener(
1751                "mouseout",
1752                () => (btn.style.backgroundColor = "#9b3e9f")
1753            );
1754            weaponMenu.appendChild(btn);
1755        });
1756
1757        return weaponMenu;
1758    }
1759
1760    window.addEventListener("keydown", (e) => {
1761        if (e.key.toLowerCase() === "v") {
1762            const savedClassID = localStorage.getItem("selectedClass");
1763            if (
1764                savedClassID !== null &&
1765                window.location.href.includes("#")
1766            ) {
1767                unityInstance.SendMessage("MapScripts", "ChangeClassTo", parseInt(savedClassID));
1768            }
1769        }
1770    });
1771
1772    /***************************************
1773   * Keybinds
1774   ***************************************/
1775
1776    let lastHash = window.location.hash;
1777
1778    setInterval(() => {
1779        const currentHash = window.location.hash;
1780
1781        // Only run if hash has changed AND there's a # in the URL
1782        if (currentHash !== lastHash && currentHash.includes("#")) {
1783            lastHash = currentHash;
1784
1785            const storedName = localStorage.getItem("playerNickname");
1786            if (storedName) {
1787                unityInstance.SendMessage("MapScripts", "SetNickname", storedName);
1788            }
1789        }
1790    }, 500);
1791
1792    let keybinds = {
1793        toggleMenu: "o",
1794    }
1795
1796    const savedKeybinds = localStorage.getItem("zephKeybinds");
1797    if (savedKeybinds) {
1798        try {
1799            keybinds = JSON.parse(savedKeybinds);
1800        } catch {}
1801    }
1802
1803    document.addEventListener("keydown", function (e) {
1804        if (e.key === keybinds.toggleMenu && !e.target.matches("input, textarea")) {
1805            const menu = document.getElementById("zephMenu");
1806            if (menu) {
1807                const isClosing = menu.style.display !== "none";
1808                menu.style.display = isClosing ? "none" : "block";
1809                if (isClosing) {
1810                    document.getElementById("zephSecondaryWeaponMenu").style.display = "none";
1811                    document.getElementById("zephMeleeWeaponMenu").style.display = "none";
1812                    document.getElementById("zephProfileModderMenu").style.display = "none";
1813                    document.getElementById("zephSkinMenu").style.display = "none";
1814                }
1815            }
1816        }
1817    });
1818
1819
1820    window.addEventListener("load", createUI);
1821})();
Kour.io Zeph Menu | Robomonkey