local success, Rayfield = pcall(function() return loadstring(game:HttpGet('https://sirius.menu/rayfield'))() end) if not success then success, Rayfield = pcall(function() return loadstring(game:HttpGet('https://raw.githubusercontent.com/shlexware/Rayfield/main/source'))() end) end local Settings = { ESP = { Enabled = false, Chams = true, Box = true, ChamsTransparency = 0.3, Color = Color3.fromRGB(255, 0, 0) } } local ESPCache = {} local CollectionService = game:GetService("CollectionService") local RunService = game:GetService("RunService") local ESP_TAG = "CharacterESP" local function CreateESP(model) if not model or ESPCache[model] then return end local highlight = Instance.new("Highlight") highlight.Name = "ESP_" .. model.Name highlight.FillColor = Settings.ESP.Chams and Settings.ESP.Color or Color3.new(0,0,0) highlight.FillTransparency = Settings.ESP.Chams and Settings.ESP.ChamsTransparency or 1 highlight.OutlineColor = Settings.ESP.Box and Settings.ESP.Color or Color3.new(0,0,0) highlight.OutlineTransparency = Settings.ESP.Box and 0 or 1 highlight.Adornee = model highlight.Parent = model ESPCache[model] = highlight model.AncestryChanged:Connect(function() if not model.Parent then ESPCache[model] = nil end end) end local function UpdateExistingESP() for model, highlight in pairs(ESPCache) do if highlight and highlight.Parent then highlight.FillColor = Settings.ESP.Chams and Settings.ESP.Color or Color3.new(0,0,0) highlight.FillTransparency = Settings.ESP.Chams and Settings.ESP.ChamsTransparency or 1 highlight.OutlineColor = Settings.ESP.Box and Settings.ESP.Color or Color3.new(0,0,0) highlight.OutlineTransparency = Settings.ESP.Box and 0 or 1 else ESPCache[model] = nil end end end local function ClearESP() for model, highlight in pairs(ESPCache) do if highlight then highlight:Destroy() end end ESPCache = {} for _, obj in pairs(CollectionService:GetTagged(ESP_TAG)) do CollectionService:RemoveTag(obj, ESP_TAG) end end local function InitializeESP() if not Settings.ESP.Enabled then return end ClearESP() local models = {} for _, model in pairs(workspace:GetDescendants()) do if model:IsA("Model") and string.find(model.Name:lower(), "character") then table.insert(models, model) end end for i, model in ipairs(models) do if not Settings.ESP.Enabled then break end CreateESP(model) if i % 3 == 0 then RunService.Heartbeat:Wait() end end end local function SetupCollectionService() CollectionService:GetInstanceAddedSignal(ESP_TAG):Connect(function(model) if Settings.ESP.Enabled then CreateESP(model) end end) spawn(function() while true do if Settings.ESP.Enabled then for _, model in pairs(workspace:GetDescendants()) do if model:IsA("Model") and string.find(model.Name:lower(), "character") then if not CollectionService:HasTag(model, ESP_TAG) then CollectionService:AddTag(model, ESP_TAG) end end end end wait(5) end end) end SetupCollectionService() if Rayfield then local Window = Rayfield:CreateWindow({ Name = "ESP", LoadingTitle = "Loading...", LoadingSubtitle = "by MEgor250412", ConfigurationSaving = { Enabled = true, FolderName = "CharacterESP", FileName = "Config" }, KeySystem = false, }) local MainTab = Window:CreateTab("Main") local ESPToggle = MainTab:CreateToggle({ Name = "ESP Enabled", CurrentValue = Settings.ESP.Enabled, Callback = function(value) Settings.ESP.Enabled = value if value then spawn(InitializeESP) else ClearESP() end end, }) local ChamsToggle = MainTab:CreateToggle({ Name = "Chams Fill", CurrentValue = Settings.ESP.Chams, Callback = function(value) Settings.ESP.Chams = value UpdateExistingESP() end, }) local BoxToggle = MainTab:CreateToggle({ Name = "Outline", CurrentValue = Settings.ESP.Box, Callback = function(value) Settings.ESP.Box = value UpdateExistingESP() end, }) local TransparencySlider = MainTab:CreateSlider({ Name = "Chams Transparency", Range = {0, 1}, Increment = 0.1, CurrentValue = Settings.ESP.ChamsTransparency, Callback = function(value) Settings.ESP.ChamsTransparency = value UpdateExistingESP() end, }) local ColorPicker = MainTab:CreateColorPicker({ Name = "ESP Color", Color = Settings.ESP.Color, Callback = function(color) Settings.ESP.Color = color UpdateExistingESP() end }) Rayfield:LoadConfiguration() else local Player = game:GetService("Players").LocalPlayer local GUI = Instance.new("ScreenGui") GUI.Name = "ESPUI" GUI.Parent = Player.PlayerGui local Frame = Instance.new("Frame") Frame.Size = UDim2.new(0, 200, 0, 200) Frame.Position = UDim2.new(0, 10, 0, 10) Frame.BackgroundColor3 = Color3.fromRGB(40, 40, 50) Frame.BorderSizePixel = 0 Frame.Parent = GUI local Corner = Instance.new("UICorner") Corner.CornerRadius = UDim.new(0, 8) Corner.Parent = Frame local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, 0, 0, 30) Title.Text = "ESP" Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.BackgroundColor3 = Color3.fromRGB(255, 50, 50) Title.Font = Enum.Font.GothamBold Title.Parent = Frame local yOffset = 40 local function CreateSimpleToggle(name, currentValue, callback) local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(0, 180, 0, 30) toggle.Position = UDim2.new(0, 10, 0, yOffset) toggle.Text = name .. ": " .. (currentValue and "ON" or "OFF") toggle.BackgroundColor3 = currentValue and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0) toggle.TextColor3 = Color3.fromRGB(255, 255, 255) toggle.Font = Enum.Font.Gotham toggle.Parent = Frame toggle.MouseButton1Click:Connect(function() currentValue = not currentValue toggle.Text = name .. ": " .. (currentValue and "ON" or "OFF") toggle.BackgroundColor3 = currentValue and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0) callback(currentValue) end) yOffset = yOffset + 35 return toggle end CreateSimpleToggle("ESP", Settings.ESP.Enabled, function(value) Settings.ESP.Enabled = value if value then spawn(InitializeESP) else ClearESP() end end) CreateSimpleToggle("Chams", Settings.ESP.Chams, function(value) Settings.ESP.Chams = value UpdateExistingESP() end) CreateSimpleToggle("Box", Settings.ESP.Box, function(value) Settings.ESP.Box = value UpdateExistingESP() end) local transparencyText = Instance.new("TextLabel") transparencyText.Size = UDim2.new(0, 180, 0, 20) transparencyText.Position = UDim2.new(0, 10, 0, yOffset) transparencyText.Text = "Transparency: " .. Settings.ESP.ChamsTransparency transparencyText.TextColor3 = Color3.fromRGB(255, 255, 255) transparencyText.BackgroundTransparency = 1 transparencyText.Font = Enum.Font.Gotham transparencyText.Parent = Frame yOffset = yOffset + 25 local transparencyBtn = Instance.new("TextButton") transparencyBtn.Size = UDim2.new(0, 180, 0, 20) transparencyBtn.Position = UDim2.new(0, 10, 0, yOffset) transparencyBtn.Text = "Click to Change" transparencyBtn.TextColor3 = Color3.fromRGB(255, 255, 255) transparencyBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 120) transparencyBtn.Font = Enum.Font.Gotham transparencyBtn.Parent = Frame transparencyBtn.MouseButton1Click:Connect(function() Settings.ESP.ChamsTransparency = Settings.ESP.ChamsTransparency + 0.1 if Settings.ESP.ChamsTransparency > 1 then Settings.ESP.ChamsTransparency = 0 end transparencyText.Text = "Transparency: " .. math.floor(Settings.ESP.ChamsTransparency * 10) / 10 UpdateExistingESP() end) end