Greasy Fork is available in English.

Paper.io Hacked Menu

Here is a simple hack menu for Paper.io!

  1. // ==UserScript==
  2. // @name Paper.io Hacked Menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 3.0
  5. // @description Here is a simple hack menu for Paper.io!
  6. // @author AA034
  7. // @match https://paper-io.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=paper-io.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let overlayHTML = `
  13. <div id="box">
  14. <div class="main" id="box2">
  15. <p style="color:white;"> PaperHack </p>
  16.  
  17. <section><label>Zoom [Scroll]</label></section>
  18. <section><label>Speed Boost [Click]</label></section>
  19. <section><label>Pause [P]</label></section>
  20. <section><button class="button" id="unlockSkins">Skins</button></section>
  21.  
  22. <section><label class="custom-checkbox"><input type="checkbox" class="checkbox-input" id="invinCheck"><span class="checkbox-icon"></span>Invincible</label></section>
  23.  
  24. <section><label class="custom-checkbox"><input type="checkbox" class="checkbox-input" id="radiCheck"><span class="checkbox-icon"></span>Auto Kill</label></section>
  25. <br>
  26. <p>M to toggle menu</p>
  27.  
  28. </div>
  29. </div>
  30.  
  31. <style>
  32. #box {
  33. z-index: 10;
  34. position: absolute;
  35. top: 256px;
  36. left: 7px;
  37. transition: 0.5s;
  38. }
  39.  
  40. #box2 {
  41. padding: 15px;
  42. margin-bottom: 5px;
  43. display: grid;
  44. }
  45.  
  46. section {
  47. margin: auto;
  48. display: flex;
  49. justify-content: space-between;padding:5px;
  50. }
  51.  
  52. .main {
  53. background-color: #363c3d;
  54. letter-spacing: 2px;
  55. font-weight: bold;
  56. font-size: 15px;
  57. font-family: 'Open Sans', sans-serif;
  58. color:white;
  59. border-radius: 8px;
  60. }
  61. p {
  62. text-align: center;
  63. border-bottom:1px solid white;
  64. border-top:1px solid white;
  65. }
  66.  
  67. label {
  68. font-weight: bold}
  69.  
  70. .button {
  71. margin: auto;
  72. background-color: #242829;
  73. color: white;
  74. font-size: 16px;
  75. border: none;
  76. padding: 8px;
  77. border-radius: 6px;
  78. transition: 0.15s;
  79. }
  80.  
  81. .button:hover {
  82. color: #a10000;
  83. }
  84.  
  85. .custom-checkbox {
  86. display: inline-block;
  87. position: relative;
  88. padding-left: 25px; /* Adjust as needed */
  89. cursor: pointer;
  90. }
  91.  
  92. .checkbox-input {
  93. position: absolute;
  94. opacity: 0;
  95. cursor: pointer;
  96. }
  97.  
  98. .checkbox-icon {
  99. position: absolute;
  100. top: 0;
  101. left: 0;
  102. width: 18px;
  103. height: 18px;
  104. background-color: #eee;
  105. border-radius: 3px;
  106. transition: background-color 0.2s;
  107. }
  108.  
  109. .checkbox-input:checked + .checkbox-icon {
  110. background-color: #a10000; /* Change to your desired color */
  111. }
  112.  
  113. .checkbox-icon:after {
  114. content: "";
  115. position: absolute;
  116. display: none;
  117. }
  118.  
  119. .checkbox-input:checked + .checkbox-icon:after {
  120. display: block;
  121. left: 6px;
  122. top: 2px;
  123. width: 5px;
  124. height: 10px;
  125. border: solid white;
  126. border-width: 0 2px 2px 0;
  127. transform: rotate(45deg);
  128. }
  129.  
  130. </style>
  131. `
  132.  
  133. //Misc stuff
  134.  
  135. function getID(x) {
  136. return document.getElementById(x)
  137. };
  138.  
  139. let overlay = document.createElement("div");
  140. overlay.innerHTML = overlayHTML;
  141. document.body.appendChild(overlay);
  142.  
  143.  
  144. let acc = getID("accordian"),
  145. unlockSkins = getID("unlockSkins"),
  146. box = getID("box"),
  147. radiBox = getID("radiCheck"),
  148. invinBox = getID('invinCheck'),
  149. paper2 = window.paper2;
  150.  
  151. //Skins
  152.  
  153. unlockSkins.onclick = function() {
  154. paper2.skins.forEach(obj => {
  155. unlockSkin(obj.name);
  156. });
  157. unlockSkin(name)
  158. shop_open()
  159. }
  160.  
  161. //Functions
  162.  
  163. function radiHack() {
  164.  
  165. let playerIndex;
  166.  
  167. for (let i = 0; i < paper2.game.units.length; i++) {
  168. if (paper2.game.units[i].name === paper2.game.player.name) {
  169. playerIndex = i;
  170. break;
  171. }
  172. }
  173.  
  174. function calculateDistance(x1, y1, x2, y2) {
  175. return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
  176. }
  177.  
  178. function checkUnitProximity() {
  179. const playerX = paper2.game.player.position.x;
  180. const playerY = paper2.game.player.position.y;
  181.  
  182. for (let i = 0; i < paper2.game.units.length; i++) {
  183. if (i !== playerIndex) {
  184. const unitX = paper2.game.units[i].position.x;
  185. const unitY = paper2.game.units[i].position.y;
  186.  
  187. const distance = calculateDistance(playerX, playerY, unitX, unitY);
  188. if (distance <= 100) {
  189. if (paper2.game.units[i] !== paper2.game.player) {
  190. paper2.game.units = paper2.game.units.filter(array => array !== paper2.game.units[i]);
  191. }
  192. }
  193. }
  194. }
  195. }
  196.  
  197. checkUnitProximity();
  198.  
  199. setInterval(checkUnitProximity, 100);
  200. }
  201.  
  202. function pauseHack() {
  203. document.addEventListener('keydown', (event) => {
  204. if (event.key === 'p') {
  205. let paused = paper2.game.paused
  206.  
  207. if(paused == false) {
  208. paper2.game.paused = true
  209. }
  210. else {
  211. paper2.game.paused = false
  212. }
  213. }
  214. })
  215. }
  216.  
  217. function invinHack() {
  218. paper2.game.player.track.unit = paper2.game.units[4]
  219. }
  220.  
  221. function speedHack() {
  222.  
  223.  
  224. function distance(x1, y1, x2, y2) {
  225. return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
  226. }
  227.  
  228. let isMouseHeld = false;
  229. let interval;
  230.  
  231. // Move the player towards the next location on left mouse button click and hold
  232. document.addEventListener("mousedown", function(event) {
  233. if (event.button === 0) { // Check if left mouse button is clicked
  234. isMouseHeld = true;
  235.  
  236. interval = setInterval(movePlayer, 16); // Update every 16ms (approximately 60fps)
  237. }
  238. });
  239.  
  240. document.addEventListener("mouseup", function(event) {
  241. if (event.button === 0) {
  242. isMouseHeld = false;
  243.  
  244. clearInterval(interval);
  245. }
  246. });
  247.  
  248. function movePlayer() {
  249.  
  250. if(paper2.game.player.baseDistance > 15) {
  251.  
  252. paper2.game.player.in = null
  253. const currentPlayerX = paper2.game.player.position.x;
  254. const currentPlayerY = paper2.game.player.position.y;
  255. const targetX = paper2.game.player.target.x;
  256. const targetY = paper2.game.player.target.y;
  257.  
  258. const distanceToTarget = distance(currentPlayerX, currentPlayerY, targetX, targetY);
  259.  
  260. const stepSize = 3.5;
  261.  
  262. if (distanceToTarget > stepSize) {
  263. const angle = Math.atan2(targetY - currentPlayerY, targetX - currentPlayerX);
  264. const newX = currentPlayerX + stepSize * Math.cos(angle);
  265. const newY = currentPlayerY + stepSize * Math.sin(angle);
  266.  
  267. paper2.game.player.position.x = newX;
  268. paper2.game.player.position.y = newY;
  269. } else {
  270. paper2.game.player.position.x = targetX;
  271. paper2.game.player.position.y = targetY;
  272.  
  273. if (!isMouseHeld) {
  274. clearInterval(interval);
  275. }
  276. }
  277. }
  278. else if(paper2.game.player.baseDistance == 0) {
  279.  
  280. paper2.game.player.in = null
  281. const currentPlayerX = paper2.game.player.position.x;
  282. const currentPlayerY = paper2.game.player.position.y;
  283. const targetX = paper2.game.player.target.x;
  284. const targetY = paper2.game.player.target.y;
  285.  
  286. const distanceToTarget = distance(currentPlayerX, currentPlayerY, targetX, targetY);
  287.  
  288. const stepSize = 3.5;
  289.  
  290. if (distanceToTarget > stepSize) {
  291. const angle = Math.atan2(targetY - currentPlayerY, targetX - currentPlayerX);
  292. const newX = currentPlayerX + stepSize * Math.cos(angle);
  293. const newY = currentPlayerY + stepSize * Math.sin(angle);
  294.  
  295. paper2.game.player.position.x = newX;
  296. paper2.game.player.position.y = newY;
  297. } else {
  298. paper2.game.player.position.x = targetX;
  299. paper2.game.player.position.y = targetY;
  300.  
  301. if (!isMouseHeld) {
  302. clearInterval(interval);
  303. }
  304. }
  305. }
  306.  
  307. }
  308.  
  309.  
  310. }
  311.  
  312. function zoomHack() {
  313. window.addEventListener('wheel', function(event) {
  314. window.paper2.configs.paper2_classic.minScale = 0.5;
  315. if (event.deltaY > 0) {
  316. if (window.paper2.configs.paper2_classic.maxScale > 0.5) {
  317. window.paper2.configs.paper2_classic.maxScale -= 0.5;
  318. }
  319. }
  320. else if (event.deltaY < 0) {
  321. if (window.paper2.configs.paper2_classic.maxScale < 4.5) {
  322. window.paper2.configs.paper2_classic.maxScale += 0.5;
  323. }
  324. }
  325. })
  326. }
  327.  
  328. //Load Game
  329.  
  330. document.querySelector("#pre_game > div.grow > div.button.play").setAttribute("id", "startButton");
  331.  
  332. document.getElementById('startButton').addEventListener("click", function() {
  333. game_start();
  334. setTimeout(function() {
  335.  
  336. if(radiBox.checked == true) {
  337. radiHack()
  338. }
  339. if(invinBox.checked == true) {
  340. invinHack()
  341. }
  342. pauseHack();
  343. speedHack();
  344. zoomHack();
  345. }, 600);
  346. });