local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer --================================================== -- SETTINGS --================================================== local GunESP = true local PickupGun = false local PlayerESP = false local GunColor = Color3.fromRGB(255, 255, 255) local PlayerColor = Color3.fromRGB(0, 170, 255) --================================================== -- GUI --================================================== local Gui = Instance.new("ScreenGui") Gui.Name = "ESP_Gui" Gui.ResetOnSpawn = false Gui.Parent = LocalPlayer:WaitForChild("PlayerGui") local Frame = Instance.new("Frame") Frame.Name = "Main" Frame.Size = UDim2.fromOffset(230, 160) Frame.Position = UDim2.new(0, 20, 0.5, -80) Frame.BackgroundColor3 = Color3.fromRGB(20, 20, 25) Frame.BorderSizePixel = 0 Frame.Parent = Gui local Corner = Instance.new("UICorner") Corner.CornerRadius = UDim.new(0, 8) Corner.Parent = Frame --================================================== -- TITLE --================================================== local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, 0, 0, 30) Title.BackgroundTransparency = 1 Title.Text = "Hack Menu" Title.TextColor3 = Color3.new(1, 1, 1) Title.TextSize = 18 Title.Font = Enum.Font.GothamBold Title.Parent = Frame --================================================== -- DRAGGING --================================================== local Dragging = false local DragStart local StartPosition Title.InputBegan:Connect(function(Input) if Input.UserInputType == Enum.UserInputType.MouseButton1 then Dragging = true DragStart = Input.Position StartPosition = Frame.Position Input.Changed:Connect(function() if Input.UserInputState == Enum.UserInputState.End then Dragging = false end end) end end) UserInputService.InputChanged:Connect(function(Input) if Dragging and Input.UserInputType == Enum.UserInputType.MouseMovement then local Delta = Input.Position - DragStart Frame.Position = UDim2.new( StartPosition.X.Scale, StartPosition.X.Offset + Delta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + Delta.Y ) end end) --================================================== -- BUTTON CREATOR --================================================== local function CreateButton(Text, Position) local Button = Instance.new("TextButton") Button.Size = UDim2.new(1, -20, 0, 35) Button.Position = Position Button.BackgroundColor3 = Color3.fromRGB(35, 35, 42) Button.BorderSizePixel = 0 Button.TextColor3 = Color3.new(1, 1, 1) Button.TextSize = 14 Button.Font = Enum.Font.Gotham Button.Text = Text Button.AutoButtonColor = true Button.Parent = Frame local ButtonCorner = Instance.new("UICorner") ButtonCorner.CornerRadius = UDim.new(0, 6) ButtonCorner.Parent = Button return Button end --================================================== -- BUTTONS --================================================== local GunButton = CreateButton( "Gun ESP: ON", UDim2.fromOffset(10, 35) ) local PickupButton = CreateButton( "Pickup Gun: OFF", UDim2.fromOffset(10, 77) ) local PlayerButton = CreateButton( "Player ESP: OFF", UDim2.fromOffset(10, 119) ) --================================================== -- GUN DRAWING --================================================== local GunLine = Drawing.new("Line") GunLine.Visible = false GunLine.Color = GunColor GunLine.Thickness = 2 GunLine.Transparency = 1 local GunText = Drawing.new("Text") GunText.Visible = false GunText.Text = "GunDrop" GunText.Color = GunColor GunText.Size = 16 GunText.Center = true GunText.Outline = true GunText.OutlineColor = Color3.new(0, 0, 0) local GunHighlight local LastGun --================================================== -- FIND GUN --================================================== local function GetGun() for _, Object in ipairs(workspace:GetDescendants()) do if Object.Name == "GunDrop" then return Object end end return nil end --================================================== -- GUN HIGHLIGHT --================================================== local function SetupGunHighlight(Gun) if GunHighlight then GunHighlight:Destroy() GunHighlight = nil end if Gun then GunHighlight = Instance.new("Highlight") GunHighlight.Name = "GunDropHighlight" GunHighlight.Adornee = Gun GunHighlight.FillColor = Color3.fromRGB(0, 100, 255) GunHighlight.FillTransparency = 0.5 GunHighlight.OutlineColor = Color3.fromRGB(0, 170, 255) GunHighlight.OutlineTransparency = 0 GunHighlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop GunHighlight.Enabled = GunESP GunHighlight.Parent = Gun end end --================================================== -- PLAYER ESP --================================================== local PlayerHighlights = {} local PlayerTexts = {} local function RemovePlayerESP(Player) if PlayerHighlights[Player] then PlayerHighlights[Player]:Destroy() PlayerHighlights[Player] = nil end if PlayerTexts[Player] then PlayerTexts[Player]:Remove() PlayerTexts[Player] = nil end end local function AddPlayerESP(Player) if Player == LocalPlayer then return end RemovePlayerESP(Player) local Character = Player.Character if not Character then return end local Highlight = Instance.new("Highlight") Highlight.Name = "PlayerESP" Highlight.Adornee = Character Highlight.FillColor = PlayerColor Highlight.OutlineColor = PlayerColor Highlight.FillTransparency = 0.65 Highlight.OutlineTransparency = 0 Highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop Highlight.Parent = Character PlayerHighlights[Player] = Highlight local Text = Drawing.new("Text") Text.Text = Player.DisplayName Text.Color = PlayerColor Text.Size = 16 Text.Center = true Text.Outline = true Text.OutlineColor = Color3.new(0, 0, 0) Text.Visible = false PlayerTexts[Player] = Text end local function RefreshPlayerESP() for _, Player in ipairs(Players:GetPlayers()) do if Player ~= LocalPlayer then if PlayerESP then AddPlayerESP(Player) else RemovePlayerESP(Player) end end end end --================================================== -- PLAYER JOIN --================================================== Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function() task.wait(0.5) if PlayerESP then AddPlayerESP(Player) end end) end) Players.PlayerRemoving:Connect(function(Player) RemovePlayerESP(Player) end) --================================================== -- GUN ESP BUTTON --================================================== GunButton.MouseButton1Click:Connect(function() GunESP = not GunESP GunButton.Text = "Gun ESP: " .. (GunESP and "ON" or "OFF") if not GunESP then GunLine.Visible = false GunText.Visible = false if GunHighlight then GunHighlight.Enabled = false end else if GunHighlight then GunHighlight.Enabled = true end end end) --================================================== -- PICKUP GUN BUTTON --================================================== PickupButton.MouseButton1Click:Connect(function() PickupGun = not PickupGun PickupButton.Text = "Pickup Gun: " .. (PickupGun and "ON" or "OFF") end) --================================================== -- CONTINUOUS GUN BRING TO TORSO --================================================== RunService.Heartbeat:Connect(function() if not PickupGun then return end local Character = LocalPlayer.Character if not Character then return end -- R15 = UpperTorso -- R6 = Torso -- Fallback = HumanoidRootPart local Torso = Character:FindFirstChild("UpperTorso") or Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") if not Torso then return end local Gun = GetGun() if not Gun then return end -- Move ONLY GunDrop to the torso local TargetCFrame = Torso.CFrame if Gun:IsA("Model") then Gun:PivotTo(TargetCFrame) elseif Gun:IsA("BasePart") then Gun.CFrame = TargetCFrame end end) --================================================== -- PLAYER ESP BUTTON --================================================== PlayerButton.MouseButton1Click:Connect(function() PlayerESP = not PlayerESP PlayerButton.Text = "Player ESP: " .. (PlayerESP and "ON" or "OFF") RefreshPlayerESP() end) --================================================== -- GUN ESP UPDATE --================================================== RunService.RenderStepped:Connect(function() local Gun = GetGun() -- Detect new GunDrop if Gun ~= LastGun then LastGun = Gun if Gun then SetupGunHighlight(Gun) elseif GunHighlight then GunHighlight:Destroy() GunHighlight = nil end end if not GunESP or not Gun then GunLine.Visible = false GunText.Visible = false if GunHighlight then GunHighlight.Enabled = false end return end if GunHighlight then GunHighlight.Enabled = true end local Camera = workspace.CurrentCamera local Position if Gun:IsA("BasePart") then Position = Gun.Position elseif Gun:IsA("Model") then Position = Gun:GetPivot().Position end if not Position then GunLine.Visible = false GunText.Visible = false return end local ScreenPosition, OnScreen = Camera:WorldToViewportPoint(Position) if OnScreen then local Mouse = UserInputService:GetMouseLocation() GunLine.Visible = true GunText.Visible = true GunLine.From = Vector2.new( Mouse.X, Mouse.Y ) GunLine.To = Vector2.new( ScreenPosition.X, ScreenPosition.Y ) GunText.Position = Vector2.new( ScreenPosition.X, ScreenPosition.Y - 25 ) else GunLine.Visible = false GunText.Visible = false end end) --================================================== -- PLAYER ESP UPDATE --================================================== RunService.RenderStepped:Connect(function() if not PlayerESP then return end local Camera = workspace.CurrentCamera for Player, Text in pairs(PlayerTexts) do local Character = Player.Character if Character then local Head = Character:FindFirstChild("Head") if Head then local ScreenPosition, OnScreen = Camera:WorldToViewportPoint( Head.Position + Vector3.new(0, 1.5, 0) ) if OnScreen then Text.Position = Vector2.new( ScreenPosition.X, ScreenPosition.Y ) Text.Visible = true else Text.Visible = false end else Text.Visible = false end else Text.Visible = false end end end)