-- Services local Players = game:GetService("Players") local RunService = game:GetService("RunService") local CoreGui = game:GetService("CoreGui") local LocalPlayer = Players.LocalPlayer -- Check if script is already running if _G.FlashESPRunning then _G.FlashESPRunning() end local active = true _G.FlashESPRunning = function() active = false end -- Toggles State local tracerToggled = false local holdingToggled = false local bodyToggled = false local nameToggled = false local healthToggled = false local distanceToggled = false local squareToggled = false -- Storage tables local highlights = {} local nameGuis = {} local healthGuis = {} local distanceGuis = {} local holdingGuis = {} local squareGuis = {} local beams = {} -- Clean up function local function cleanPlayer(p) if highlights[p] then highlights[p]:Destroy(); highlights[p] = nil end if nameGuis[p] then nameGuis[p]:Destroy(); nameGuis[p] = nil end if healthGuis[p] then healthGuis[p]:Destroy(); healthGuis[p] = nil end if distanceGuis[p] then distanceGuis[p]:Destroy(); distanceGuis[p] = nil end if holdingGuis[p] then holdingGuis[p]:Destroy(); holdingGuis[p] = nil end if squareGuis[p] then squareGuis[p]:Destroy(); squareGuis[p] = nil end if beams[p] then if beams[p].Beam then beams[p].Beam:Destroy() end if beams[p].Att0 then beams[p].Att0:Destroy() end if beams[p].Att1 then beams[p].Att1:Destroy() end beams[p] = nil end end Players.PlayerRemoving:Connect(function(p) cleanPlayer(p) end) -- UI Setup local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "FlashESPGui" ScreenGui.ResetOnSpawn = false pcall(function() if gethui then ScreenGui.Parent = gethui() else ScreenGui.Parent = CoreGui end end) if not ScreenGui.Parent then ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end -- Main Frame (Expanded height to fit 7 buttons) local MainFrame = Instance.new("Frame", ScreenGui) MainFrame.Size = UDim2.new(0, 200, 0, 340) MainFrame.Position = UDim2.new(0, 50, 0, 100) MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25) MainFrame.BorderSizePixel = 0 MainFrame.Active = true MainFrame.Draggable = true local UICorner = Instance.new("UICorner", MainFrame) UICorner.CornerRadius = UDim.new(0, 8) -- Title local Title = Instance.new("TextLabel", MainFrame) Title.Size = UDim2.new(1, 0, 0, 35) Title.BackgroundTransparency = 1 Title.Text = "FlashESP" Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.TextSize = 16 Title.Font = Enum.Font.SourceSansBold -- Helper function to create toggle buttons local function createButton(name, yPos, callback) local btn = Instance.new("TextButton", MainFrame) btn.Size = UDim2.new(1, -20, 0, 35) btn.Position = UDim2.new(0, 10, 0, yPos) btn.BackgroundColor3 = Color3.fromRGB(45, 45, 45) btn.TextColor3 = Color3.fromRGB(200, 200, 200) btn.TextSize = 14 btn.Font = Enum.Font.SourceSansSemibold btn.Text = name .. ": OFF" local corner = Instance.new("UICorner", btn) corner.CornerRadius = UDim.new(0, 6) local state = false btn.MouseButton1Click:Connect(function() state = not state if state then btn.BackgroundColor3 = Color3.fromRGB(0, 120, 215) btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Text = name .. ": ON" else btn.BackgroundColor3 = Color3.fromRGB(45, 45, 45) btn.TextColor3 = Color3.fromRGB(200, 200, 200) btn.Text = name .. ": OFF" end callback(state) end) end -- Create UI Toggles createButton("Tracers", 40, function(state) tracerToggled = state end) createButton("Holding Track", 80, function(state) holdingToggled = state end) createButton("Body ESP", 120, function(state) bodyToggled = state end) createButton("Name ESP", 160, function(state) nameToggled = state end) createButton("Health ESP", 200, function(state) healthToggled = state end) createButton("Distance ESP", 240, function(state) distanceToggled = state end) createButton("2D Square", 280, function(state) squareToggled = state end) -- Minimize Button local MinBtn = Instance.new("TextButton", MainFrame) MinBtn.Size = UDim2.new(0, 30, 0, 30) MinBtn.Position = UDim2.new(1, -35, 0, 3) MinBtn.BackgroundTransparency = 1 MinBtn.Text = "-" MinBtn.TextColor3 = Color3.fromRGB(255, 255, 255) MinBtn.TextSize = 20 local minimized = false MinBtn.MouseButton1Click:Connect(function() minimized = not minimized for _, child in ipairs(MainFrame:GetChildren()) do if child:IsA("TextButton") and child ~= MinBtn then child.Visible = not minimized end end MainFrame.Size = minimized and UDim2.new(0, 200, 0, 40) or UDim2.new(0, 200, 0, 340) end) -- Main Render Loop RunService.RenderStepped:Connect(function() if not active then return end local lChar = LocalPlayer.Character local lHead = lChar and lChar:FindFirstChild("Head") for _, p in ipairs(Players:GetPlayers()) do if p ~= LocalPlayer then local char = p.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local root = char and char:FindFirstChild("HumanoidRootPart") local head = char and char:FindFirstChild("Head") local isAlive = hum and hum.Health > 0 and root and head if isAlive then -- 1. Tracers (Beams) if tracerToggled and lHead then if not beams[p] or beams[p].Att1.Parent ~= root then if beams[p] then if beams[p].Beam then beams[p].Beam:Destroy() end if beams[p].Att0 then beams[p].Att0:Destroy() end if beams[p].Att1 then beams[p].Att1:Destroy() end end local att0 = Instance.new("Attachment", lHead) local att1 = Instance.new("Attachment", root) local beam = Instance.new("Beam", lHead) beam.Attachment0 = att0 beam.Attachment1 = att1 beam.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0)) beam.Width0 = 0.05 beam.Width1 = 0.05 beam.FaceCamera = true beams[p] = {Beam = beam, Att0 = att0, Att1 = att1} end else if beams[p] then if beams[p].Beam then beams[p].Beam:Destroy() end if beams[p].Att0 then beams[p].Att0:Destroy() end if beams[p].Att1 then beams[p].Att1:Destroy() end beams[p] = nil end end -- 2. Holding Item Track if holdingToggled then local tool = char:FindFirstChildOfClass("Tool") local toolName = tool and tool.Name or "None" if not holdingGuis[p] or holdingGuis[p].Adornee ~= head then if holdingGuis[p] then holdingGuis[p]:Destroy() end local bg = Instance.new("BillboardGui", head) bg.Size = UDim2.new(0, 120, 0, 30) bg.StudsOffset = Vector3.new(0, -1.6, 0) bg.AlwaysOnTop = true bg.Adornee = head local lbl = Instance.new("TextLabel", bg) lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.Text = "Item: " .. toolName lbl.TextColor3 = Color3.fromRGB(255, 140, 0) lbl.TextStrokeTransparency = 0 lbl.TextSize = 12 holdingGuis[p] = bg else local lbl = holdingGuis[p]:FindFirstChildOfClass("TextLabel") if lbl then lbl.Text = "Item: " .. toolName end end else if holdingGuis[p] then holdingGuis[p]:Destroy(); holdingGuis[p] = nil end end -- 3. Body ESP (Highlight) if bodyToggled then if not highlights[p] or highlights[p].Parent ~= char then if highlights[p] then highlights[p]:Destroy() end local hl = Instance.new("Highlight") hl.Adornee = char hl.FillColor = Color3.fromRGB(255, 0, 0) hl.OutlineColor = Color3.fromRGB(255, 255, 255) hl.FillTransparency = 0.5 hl.Parent = char highlights[p] = hl end else if highlights[p] then highlights[p]:Destroy(); highlights[p] = nil end end -- 4. Name ESP if nameToggled then if not nameGuis[p] or nameGuis[p].Adornee ~= head then if nameGuis[p] then nameGuis[p]:Destroy() end local bg = Instance.new("BillboardGui", head) bg.Size = UDim2.new(0, 100, 0, 30) bg.StudsOffset = Vector3.new(0, 2, 0) bg.AlwaysOnTop = true bg.Adornee = head local lbl = Instance.new("TextLabel", bg) lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.Text = p.Name lbl.TextColor3 = Color3.fromRGB(255, 255, 255) lbl.TextStrokeTransparency = 0 lbl.TextSize = 14 nameGuis[p] = bg end else if nameGuis[p] then nameGuis[p]:Destroy(); nameGuis[p] = nil end end -- 5. Health ESP if healthToggled then if not healthGuis[p] or healthGuis[p].Adornee ~= head then if healthGuis[p] then healthGuis[p]:Destroy() end local bg = Instance.new("BillboardGui", head) bg.Size = UDim2.new(0, 100, 0, 30) bg.StudsOffset = Vector3.new(0, 0.8, 0) bg.AlwaysOnTop = true bg.Adornee = head local lbl = Instance.new("TextLabel", bg) lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.Text = "HP: " .. math.floor(hum.Health) lbl.TextColor3 = Color3.fromRGB(0, 255, 0) lbl.TextStrokeTransparency = 0 lbl.TextSize = 12 healthGuis[p] = bg else local lbl = healthGuis[p]:FindFirstChildOfClass("TextLabel") if lbl then lbl.Text = "HP: " .. math.floor(hum.Health) end end else if healthGuis[p] then healthGuis[p]:Destroy(); healthGuis[p] = nil end end -- 6. Distance ESP if distanceToggled and lHead then local dist = math.floor((lHead.Position - root.Position).Magnitude) if not distanceGuis[p] or distanceGuis[p].Adornee ~= head then if distanceGuis[p] then distanceGuis[p]:Destroy() end local bg = Instance.new("BillboardGui", head) bg.Size = UDim2.new(0, 100, 0, 30) bg.StudsOffset = Vector3.new(0, -0.4, 0) bg.AlwaysOnTop = true bg.Adornee = head local lbl = Instance.new("TextLabel", bg) lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.Text = dist .. " studs" lbl.TextColor3 = Color3.fromRGB(255, 255, 0) lbl.TextStrokeTransparency = 0 lbl.TextSize = 12 distanceGuis[p] = bg else local lbl = distanceGuis[p]:FindFirstChildOfClass("TextLabel") if lbl then local dist = math.floor((lHead.Position - root.Position).Magnitude) lbl.Text = dist .. " studs" end end else if distanceGuis[p] then distanceGuis[p]:Destroy(); distanceGuis[p] = nil end end -- 7. 2D Square Box ESP if squareToggled then if not squareGuis[p] or squareGuis[p].Adornee ~= root then if squareGuis[p] then squareGuis[p]:Destroy() end local bg = Instance.new("BillboardGui", root) bg.Size = UDim2.new(3, 0, 5, 0) -- Frames the whole body size in studs bg.StudsOffset = Vector3.new(0, 0, 0) bg.AlwaysOnTop = true bg.Adornee = root local box = Instance.new("Frame", bg) box.Size = UDim2.new(1, 0, 1, 0) box.BackgroundTransparency = 1 local stroke = Instance.new("UIStroke", box) stroke.Thickness = 1.5 stroke.Color = Color3.fromRGB(255, 255, 255) squareGuis[p] = bg end else if squareGuis[p] then squareGuis[p]:Destroy(); squareGuis[p] = nil end end else -- Clean up if dead or not spawned cleanPlayer(p) end end end end)