Advertisement
TotallyGames

WH script

Feb 2nd, 2025 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | Gaming | 0 0
  1. local function Wallhack()
  2.     local Players = game:GetService("Players")
  3.     local RunService = game:GetService("RunService")
  4.     local Camera = workspace.CurrentCamera
  5.     local LocalPlayer = Players.LocalPlayer
  6.  
  7.     local HeadOffset = Vector3.new(0, 0.5, 0)
  8.     local LegOffset = Vector3.new(0, 3, 0)
  9.  
  10.     local EspBoxes = {}
  11.     local EspEnabled = true
  12.  
  13.     local function CreateESP(player)
  14.         if player == LocalPlayer then return end
  15.  
  16.         local Box = Drawing.new("Square")
  17.         Box.Visible = false
  18.         Box.Color = Color3.fromRGB(255, 0, 0)
  19.         Box.Thickness = 1
  20.         Box.Transparency = 1
  21.         Box.Filled = false
  22.  
  23.  
  24.         local FixedBoxSize = 50
  25.  
  26.         EspBoxes[player] = Box
  27.  
  28.         local function UpdateESP()
  29.             if not EspEnabled or not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then
  30.                 Box.Visible = false
  31.                 return
  32.             end
  33.  
  34.             local RootPart = player.Character.HumanoidRootPart
  35.             local Head = player.Character:FindFirstChild("Head")
  36.             local _, onScreen = Camera:WorldToViewportPoint(RootPart.Position)
  37.  
  38.             if onScreen and Head then
  39.                 local HeadPosition = Camera:WorldToViewportPoint(Head.Position + HeadOffset)
  40.                 local LegPosition = Camera:WorldToViewportPoint(RootPart.Position - LegOffset)
  41.  
  42.  
  43.                 local BoxSize = Vector2.new(FixedBoxSize, HeadPosition.Y - LegPosition.Y)
  44.                 local BoxPosition = Vector2.new(Camera:WorldToViewportPoint(RootPart.Position).X - BoxSize.X / 2, HeadPosition.Y)
  45.  
  46.                 Box.Size = BoxSize
  47.                 Box.Position = BoxPosition
  48.                 Box.Visible = true
  49.             else
  50.                 Box.Visible = false
  51.             end
  52.         end
  53.  
  54.  
  55.         EspBoxes[player].Connection = RunService.RenderStepped:Connect(UpdateESP)
  56.     end
  57.  
  58.     local function RemoveESP()
  59.         for player, box in pairs(EspBoxes) do
  60.             if box then
  61.                 box.Visible = false
  62.                 EspBoxes[player] = nil
  63.             end
  64.         end
  65.     end
  66.  
  67.  
  68.     for _, player in ipairs(Players:GetPlayers()) do
  69.         if player ~= LocalPlayer then
  70.             CreateESP(player)
  71.         end
  72.     end
  73.  
  74.  
  75.     Players.PlayerAdded:Connect(function(player)
  76.         if player ~= LocalPlayer then
  77.             player.CharacterAdded:Connect(function()
  78.                 CreateESP(player)
  79.             end)
  80.         end
  81.     end)
  82. end
  83.  
  84. Wallhack()
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement