local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local RunService = game:GetService("RunService") local Camera = workspace.CurrentCamera local function safeColor(c, def) return (typeof(c) == "Color3") and c or (def or Color3.fromRGB(255,255,255)) end local PlayerESP = { Enabled = false, MaxDistance = 750, HighlightFillColor = Color3.fromRGB(80,255,0), HighlightOutlineColor = Color3.fromRGB(25,25,25), ESPObjects = {}, } local BackpackESP = { Enabled = false, MaxDistance = 750, HighlightFillColor = Color3.fromRGB(0,255,255), HighlightOutlineColor = Color3.fromRGB(0,100,100), ESPObjects = {}, } local function IsValidPlayerModel(model) local head = model:FindFirstChild("Head") local nametag = head and head:FindFirstChild("Nametag") if head and nametag and nametag:IsA("BillboardGui") then return head, nametag end return nil, nil end local function GetPlayerName(nametag) if not nametag then return "(No Name)" end for _, child in ipairs(nametag:GetChildren()) do if child:IsA("TextLabel") and child.Text and child.Text ~= "" then return child.Text end end return "(No Name)" end local function IsBackpackModel(model) local Artichoke = Color3.fromRGB(143,151,121) local BrightBlue = Color3.fromRGB(0,135,255) local hasArtichoke, hasBrightBlue = false, false for _, child in pairs(model:GetChildren()) do if child:IsA("BasePart") then if child.Color == Artichoke then hasArtichoke = true end if child.Color == BrightBlue then hasBrightBlue = true end end end return hasArtichoke and hasBrightBlue end local function CreateESP(container, model, fillColor, outlineColor) if container.ESPObjects[model] then return end local highlight = Instance.new("Highlight") highlight.Adornee = model highlight.FillColor = fillColor highlight.OutlineColor = outlineColor highlight.Parent = model local txt = Drawing.new("Text") txt.Size = 16 txt.Center = true txt.Outline = true txt.Color = fillColor container.ESPObjects[model] = {highlight = highlight, text = txt} end local function RemoveESP(container, model) local obj = container.ESPObjects[model] if obj then if obj.highlight then obj.highlight:Destroy() end if obj.text then obj.text:Remove() end container.ESPObjects[model] = nil end end local function UpdateESP(container, isBackpack) if not container.Enabled then return end for model in pairs(container.ESPObjects) do if not model.Parent then RemoveESP(container, model) end end for _, model in ipairs(workspace:GetChildren()) do if model:IsA("Model") and model.Name == "Model" then local refPart = nil local nameStr = "" if isBackpack then if not IsBackpackModel(model) then RemoveESP(container, model) goto continue end refPart = model:FindFirstChildWhichIsA("BasePart") nameStr = "Backpack" else local head, nametag = IsValidPlayerModel(model) if not head or not nametag then RemoveESP(container, model) goto continue end refPart = head nameStr = GetPlayerName(nametag) end if refPart then local dist = (refPart.Position - Camera.CFrame.Position).Magnitude if dist <= container.MaxDistance then if not container.ESPObjects[model] then CreateESP(container, model, safeColor(container.HighlightFillColor), safeColor(container.HighlightOutlineColor)) end local esp = container.ESPObjects[model] esp.text.Text = nameStr .. ", " .. math.floor(dist) .. "m" esp.text.Color = safeColor(container.HighlightFillColor) local screenPos, onScreen = Camera:WorldToViewportPoint(refPart.Position + Vector3.new(0, 2, 0)) esp.text.Visible = onScreen if onScreen then esp.text.Position = Vector2.new(screenPos.X, screenPos.Y) end esp.highlight.FillColor = safeColor(container.HighlightFillColor) esp.highlight.OutlineColor = safeColor(container.HighlightOutlineColor) else RemoveESP(container, model) end end ::continue:: end end end local window = Rayfield:CreateWindow({Name = "ESP System", LoadingTitle = "Loading", LoadingSubtitle = "by User"}) local playerTab = window:CreateTab("Players ESP") local playerSection = playerTab:CreateSection("Player ESP Options") playerSection:CreateToggle({ Name = "Enable Player ESP", CurrentValue = PlayerESP.Enabled, Callback = function(val) PlayerESP.Enabled = val if not val then for model in pairs(PlayerESP.ESPObjects) do RemoveESP(PlayerESP, model) end end end, }) playerSection:CreateColorPicker({ Name = "Player Highlight Fill Color", Default = safeColor(PlayerESP.HighlightFillColor, Color3.fromRGB(80, 255, 0)), Callback = function(c) PlayerESP.HighlightFillColor = safeColor(c, Color3.fromRGB(80, 255, 0)) end, }) playerSection:CreateColorPicker({ Name = "Player Highlight Outline Color", Default = safeColor(PlayerESP.HighlightOutlineColor, Color3.fromRGB(25, 25, 25)), Callback = function(c) PlayerESP.HighlightOutlineColor = safeColor(c, Color3.fromRGB(25, 25, 25)) end, }) playerSection:CreateSlider({ Name = "Player Max Distance", Range = {50, 25000}, Increment = 50, Suffix = "studs", CurrentValue = PlayerESP.MaxDistance, Callback = function(val) PlayerESP.MaxDistance = val end, }) local backpackTab = window:CreateTab("Backpack ESP") local backpackSection = backpackTab:CreateSection("Backpack ESP Options") backpackSection:CreateToggle({ Name = "Enable Backpack ESP", CurrentValue = BackpackESP.Enabled, Callback = function(val) BackpackESP.Enabled = val if not val then for model in pairs(BackpackESP.ESPObjects) do RemoveESP(BackpackESP, model) end end end, }) backpackSection:CreateColorPicker({ Name = "Backpack Highlight Fill Color", Default = safeColor(BackpackESP.HighlightFillColor, Color3.fromRGB(0, 255, 255)), Callback = function(c) BackpackESP.HighlightFillColor = safeColor(c, Color3.fromRGB(0, 255, 255)) end, }) backpackSection:CreateColorPicker({ Name = "Backpack Highlight Outline Color", Default = safeColor(BackpackESP.HighlightOutlineColor, Color3.fromRGB(0, 100, 100)), Callback = function(c) BackpackESP.HighlightOutlineColor = safeColor(c, Color3.fromRGB(0, 100, 100)) end, }) backpackSection:CreateSlider({ Name = "Backpack Max Distance", Range = {50, 25000}, Increment = 50, Suffix = "studs", CurrentValue = BackpackESP.MaxDistance, Callback = function(val) BackpackESP.MaxDistance = val end, }) RunService.RenderStepped:Connect(function() UpdateESP(PlayerESP, false) UpdateESP(BackpackESP, true) end)