Bật/tắt tăng tốc độ nhảy bằng phím dấu phẩy (,)
// ==UserScript==
// @name Player Jump Booster
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Bật/tắt tăng tốc độ nhảy bằng phím dấu phẩy (,)
// @author YourName
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let isActive = false;
const JUMP_SPEED = 15;
// Tạo nút hiển thị trạng thái nhỏ gọn
const btn = document.createElement('div');
btn.innerHTML = "Jump: OFF";
Object.assign(btn.style, {
position: 'fixed',
bottom: '10px',
right: '10px',
padding: '4px 8px',
background: 'rgba(0, 0, 0, 0.7)',
color: 'white',
fontSize: '11px',
borderRadius: '4px',
zIndex: '9999',
pointerEvents: 'none',
fontFamily: 'sans-serif'
});
document.body.appendChild(btn);
// Hàm cập nhật trạng thái
function toggleHack() {
isActive = !isActive;
btn.innerHTML = `Jump: ${isActive ? 'ON' : 'OFF'}`;
btn.style.color = isActive ? '#00ff00' : 'white';
}
// Lắng nghe phím phẩy (,)
window.addEventListener('keydown', (e) => {
if (e.key === ',') {
toggleHack();
}
});
// Logic chính của bạn
api.on("join", (player) => {
// Ghi đè hàm hoặc kiểm tra trạng thái khi nhảy
const originalJump = player.setJumpSpeed;
// Vòng lặp kiểm tra hoặc hook vào sự kiện nhảy của game
setInterval(() => {
if (isActive) {
player.setJumpSpeed(JUMP_SPEED);
} else {
player.setJumpSpeed(2); // Giả sử 2 là tốc độ mặc định
}
}, 100);
});
})();