// ==UserScript== // @name Krunker.IO Aimbot & ESP // @namespace http://tampermonkey.net/ // @version 0.1.8 // @description Locks aim to the nearest player in krunker.io and shows players behind walls. Also shows a line between you and them. // @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; let espLinesEnabled = true; 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.get; WeakMap.prototype.get = function ( object ) { if ( object.type === 'Scene' && object.name === 'Main' ) { scene = object; } return old.apply( this, arguments ); } const line = new THREE.LineSegments( new THREE.BufferGeometry(), material ); line.frustumCulled = false; const linePositions = new THREE.BufferAttribute( new Float32Array( 100 * 2 * 3 ), 3 ); line.geometry.setAttribute( 'position', linePositions ); 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 ); } } catch ( err ) {} } } let counter = 0; let targetPlayer; let minDistance = Infinity; tempObject.matrix.copy( myPlayer.matrix ).invert() for ( let i = 0; i < players.length; i ++ ) { const player = players[ i ]; if ( ! player.box ) { const box = new THREE.LineSegments( geometry, material ); box.frustumCulled = false; player.add( box ); player.box = box; } if ( player.position.x === myPlayer.position.x && player.position.z === myPlayer.position.z ) { player.box.visible = false; if ( line.parent !== player ) { player.add( line ); } continue; } linePositions.setXYZ( counter ++, 0, 10, - 5 ); tempVector.copy( player.position ); tempVector.y += 9; tempVector.applyMatrix4( tempObject.matrix ); linePositions.setXYZ( counter ++, tempVector.x, tempVector.y, tempVector.z ); player.visible = espEnabled || player.visible; player.box.visible = espEnabled; const distance = player.position.distanceTo( myPlayer.position ); if ( distance < minDistance ) { targetPlayer = player; minDistance = distance; } } linePositions.needsUpdate = true; line.geometry.setDrawRange( 0, counter ); line.visible = espLinesEnabled; if ( aimbotEnabled === false || ( aimbotOnRightMouse && ! rightMouseDown ) || 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 = `