Flying Car - PolyTrack

Enables a flying car mode in PolyTrack using the F key

// ==UserScript==
// @name         Flying Car - PolyTrack
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Enables a flying car mode in PolyTrack using the F key
// @author       You
// @match        https://app-polytrack.kodub.com/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kodub.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    let flyingMode = false; // Tracks whether flying mode is enabled

    // Function to toggle flying mode
    function toggleFlyingMode() {
        flyingMode = !flyingMode;
        if (flyingMode) {
            console.log("Flying mode activated!");
        } else {
            console.log("Flying mode deactivated!");
        }
    }

    // Listen for the F key to toggle flying mode
    document.addEventListener("keydown", (event) => {
        if (event.key.toLowerCase() === "f") {
            toggleFlyingMode();
        }
    });

    // Modify car physics continuously
    function modifyCarPhysics() {
        let game = window.game; // Adjust this based on how PolyTrack stores game objects

        if (!game || !game.car) return;

        if (flyingMode) {
            game.car.velocity.y = -5; // Adjust this value to control flying height
            game.car.gravity = 0; // Disable gravity while flying
        } else {
            game.car.gravity = 9.8; // Restore normal gravity
        }

        requestAnimationFrame(modifyCarPhysics);
    }

    modifyCarPhysics(); // Start modifying car physics

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址