// ==UserScript== // @name Krunker.IO Aimbot & ESP // @namespace http://tampermonkey.net/ // @version 0.1.6 // @description Locks aim to the nearest player in krunker.io and shows players behind walls. // @author Zertalious (Zert) // @match *://krunker.io/* // @exclude *://krunker.io/social* // @exclude *://krunker.io/editor* // @icon https://www.google.com/s2/favicons?domain=krunker.io // @grant none // @run-at document-end // @require https://unpkg.com/three@latest/build/three.min.js // @antifeature ads // @downloadURL none // ==/UserScript== let espEnabled = true; let aimbotEnabled = true; let aimbotOnRightMouse = false; const tempVector = new THREE.Vector3(); const tempObject = new THREE.Object3D(); tempObject.rotation.order = 'YXZ'; const geometry = new THREE.EdgesGeometry( new THREE.BoxGeometry( 5, 15, 5 ).translate( 0, 7.5, 0 ) ); const material = new THREE.RawShaderMaterial( { vertexShader: ` attribute vec3 position; uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); gl_Position.z = 1.0; } `, fragmentShader: ` void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); } ` } ); let scene; const old = WeakMap.prototype.set; WeakMap.prototype.set = function ( object ) { if ( object.type === 'Scene' && object.name === 'Main' ) { scene = object; } return old.apply( this, arguments ); } function animate() { window.requestAnimationFrame( animate ); if ( typeof shouldShowAd === 'undefined' || shouldShowAd === true || scene === undefined ) { return; } const players = []; let myPlayer; for ( let i = 0; i < scene.children.length; i ++ ) { const child = scene.children[ i ]; if ( child.type === 'Object3D' ) { try { if ( child.children[ 0 ].children[ 0 ].type === 'PerspectiveCamera' ) { myPlayer = child; } else { players.push( child ); child.visible = espEnabled || child.visible; if ( ! child.box ) { const box = new THREE.LineSegments( geometry, material ); box.frustumCulled = false; child.add( box ); child.box = box; } child.box.visible = espEnabled; } } catch ( err ) {} } } if ( aimbotEnabled === false || ( aimbotOnRightMouse && ! rightMouseDown ) || players.length < 2 ) { return; } let targetPlayer; let minDistance = Infinity; for ( let i = 0; i < players.length; i ++ ) { const player = players[ i ]; if ( player.position.x === myPlayer.position.x && player.position.z === myPlayer.position.z ) { continue; } const distance = player.position.distanceTo( myPlayer.position ); if ( distance < minDistance ) { targetPlayer = player; minDistance = distance; } } if ( targetPlayer === undefined ) { return; } tempVector.setScalar( 0 ); targetPlayer.children[ 0 ].children[ 0 ].localToWorld( tempVector ); tempObject.position.copy( myPlayer.position ); tempObject.lookAt( tempVector ); myPlayer.children[ 0 ].rotation.x = - tempObject.rotation.x; myPlayer.rotation.y = tempObject.rotation.y + Math.PI; } const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 ); const shouldShowAd = isNaN( value ) || Date.now() - value < 0 || Date.now() - value > 10 * 60 * 1000; const el = document.createElement( 'div' ); el.innerHTML = `
${shouldShowAd ? `Loading ad...` : `
== Aimbot & ESP ==

[B] to toggle aimbot
[V] to toggle ESP
[L] to toggle aimbot on
right mouse hold
[H] to show/hide help

By Zertalious

Discord
Instagram
Twitter
More scripts
` }
`; const msgEl = el.querySelector( '.msg' ); const dialogEl = el.querySelector( '.dialog' ); while ( el.children.length > 0 ) { document.body.appendChild( el.children[ 0 ] ); } if ( shouldShowAd ) { const url = new URL( window.location.href ); url.searchParams.set( 'showAd', Date.now().toString( 16 ) ); url.searchParams.set( 'scriptVersion', GM.info.script.version ); window.location.href = 'https://zertalious.xyz?ref=' + new TextEncoder().encode( url.href ).toString(); } let rightMouseDown = false; function handleMouse( event ) { if ( event.button === 2 ) { rightMouseDown = event.type === 'pointerdown' ? true : false; } } window.addEventListener( 'pointerdown', handleMouse ); window.addEventListener( 'pointerup', handleMouse ); window.addEventListener( 'keyup', function ( event ) { switch ( event.code ) { case 'KeyV' : espEnabled = ! espEnabled; showMsg( 'ESP', espEnabled ); break; case 'KeyB' : aimbotEnabled = ! aimbotEnabled; showMsg( 'Aimbot', aimbotEnabled ); break; case 'KeyH' : dialogEl.style.display = dialogEl.style.display === '' ? 'none' : ''; break; case 'KeyL' : aimbotOnRightMouse = ! aimbotOnRightMouse; showMsg( 'Aimbot On Right Mouse Hold', aimbotOnRightMouse ); break; } } ); function showMsg( name, bool ) { msgEl.innerText = name + ': ' + ( bool ? 'ON' : 'OFF' ); msgEl.style.display = 'none'; void msgEl.offsetWidth; msgEl.style.display = ''; } animate();