Shell Shockers - Actual Invisibility with Visual Cue and Freeze

Make yourself truly invisible and show visual cue, plus freeze players!

  1. // ==UserScript==
  2. // @name Shell Shockers - Actual Invisibility with Visual Cue and Freeze
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Make yourself truly invisible and show visual cue, plus freeze players!
  6. // @author You
  7. // @match https://shellshock.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. let isInvisible = false; // Flag for invisibility
  15. let frozenPlayers = []; // Store frozen players
  16. let playerElement = null; // Your player element
  17. let invisibilityIndicator = null; // Visual indicator for invisibility
  18.  
  19. // Wait for the page to load and find the player element
  20. window.addEventListener('load', () => {
  21. playerElement = document.querySelector('.player'); // Find player element
  22.  
  23. // Create invisibility indicator (small icon or text that shows when invisible)
  24. invisibilityIndicator = document.createElement('div');
  25. invisibilityIndicator.textContent = "Invisible!";
  26. invisibilityIndicator.style.position = 'absolute';
  27. invisibilityIndicator.style.fontSize = '16px';
  28. invisibilityIndicator.style.color = 'red';
  29. invisibilityIndicator.style.top = '10px';
  30. invisibilityIndicator.style.right = '10px';
  31. invisibilityIndicator.style.fontWeight = 'bold';
  32. invisibilityIndicator.style.display = 'none'; // Hide initially
  33. document.body.appendChild(invisibilityIndicator);
  34.  
  35. // Set up event listeners for key presses
  36. document.addEventListener('keydown', function(event) {
  37. if (event.key === 'y' || event.key === 'Y') {
  38. freezeAllPlayers(); // Freeze all players when Y is pressed
  39. }
  40.  
  41. if (event.key === 'i' || event.key === 'I') {
  42. toggleInvisibility(); // Toggle invisibility when I is pressed
  43. }
  44. });
  45. });
  46.  
  47. // Function to freeze all players (disable movement and shooting)
  48. function freezeAllPlayers() {
  49. const players = document.querySelectorAll('.player'); // Find all players
  50.  
  51. players.forEach(player => {
  52. // Check if the player is already frozen
  53. if (!frozenPlayers.includes(player)) {
  54. frozenPlayers.push(player);
  55.  
  56. // Freeze the player: Disable interaction and movement
  57. player.style.pointerEvents = 'none'; // Disable clicks, shooting, and interactions
  58. player.style.opacity = '0.2'; // Make player semi-transparent to indicate freeze
  59.  
  60. // Optionally, make frozen players visually appear frozen
  61. player.style.position = 'absolute';
  62. player.style.zIndex = '9999';
  63. player.style.top = player.offsetTop + 'px';
  64. player.style.left = player.offsetLeft + 'px';
  65.  
  66. alert(`Player ${player.getAttribute('data-name') || 'Unknown'} is frozen!`);
  67. }
  68. });
  69. }
  70.  
  71. // Function to toggle invisibility for you and all players
  72. function toggleInvisibility() {
  73. if (!playerElement) return; // If no player element is found, do nothing
  74.  
  75. isInvisible = !isInvisible; // Toggle invisibility state
  76.  
  77. // Apply invisibility to yourself and all players
  78. const players = document.querySelectorAll('.player');
  79. players.forEach(player => {
  80. if (isInvisible) {
  81. player.style.visibility = 'hidden'; // Completely hide the player (invisible)
  82. } else {
  83. player.style.visibility = 'visible'; // Show the player again
  84. }
  85. });
  86.  
  87. // Show or hide the invisibility indicator
  88. invisibilityIndicator.style.display = isInvisible ? 'block' : 'none'; // Show indicator when invisible
  89.  
  90. // Optional: Show message when invisibility is toggled
  91. alert(isInvisible ? "You and all players are now invisible!" : "Players are now visible!");
  92. }
  93.  
  94. })();