您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allows the player to shoot lasers with a time limit
// ==UserScript== // @name Laser Shooter Mod // @description Allows the player to shoot lasers with a time limit // @match *://*/* // @version 0.0.1.20230814222938 // @namespace https://greasyfork.org/users/1151605 // ==/UserScript== (function() { 'use strict'; const TIME_LIMIT = 60; // Time limit in seconds let remainingTime = TIME_LIMIT; let isShooting = false; console.log("Hold 'O' to shoot lasers!"); function startShootingLasersOnHold() { document.addEventListener('keydown', function(event) { if (event.key === 'o' || event.key === 'O') { isShooting = true; console.log("Shooting lasers!"); } }); document.addEventListener('keyup', function(event) { if (event.key === 'o' || event.key === 'O') { isShooting = false; console.log("Stopped shooting lasers!"); } }); } function stopShootingLasers() { console.log("Time's up! Stop shooting lasers!"); isShooting = false; } // Call this function when the player dies function playerDied() { console.log("Player died! Cannot shoot lasers anymore."); } // Start shooting lasers when holding 'O' startShootingLasersOnHold(); // Run the game for the specified time limit setTimeout(function() { stopShootingLasers(); }, TIME_LIMIT * 1000); })();