if game.PlaceId == 189707 then

--// Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")

--// Rayfield
local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
    Name = "Rayfield Example Window",
    Icon = 0,
    LoadingTitle = "Rayfield Interface Suite",
    LoadingSubtitle = "by Sirius",
    ShowText = "Rayfield",
    Theme = "Default",

    ToggleUIKeybind = "K",

    DisableRayfieldPrompts = false,
    DisableBuildWarnings = false,

    ConfigurationSaving = {
        Enabled = true,
        FolderName = nil,
        FileName = "Big Hub"
    },

    Discord = {
        Enabled = false,
        Invite = "noinvitelink",
        RememberJoins = true
    },

    KeySystem = true,
    KeySettings = {
        Title = "Untitled",
        Subtitle = "Key System",
        Note = "https://[Log in to view URL]",
        FileName = "Key",
        SaveKey = true,
        GrabKeyFromSite = true,
        Key = {"FREEKEY---348327438274875"}
    }
})

----------------------------------------------------------------
-- HOME TAB
----------------------------------------------------------------
local HomeTab = Window:CreateTab("Home🏠", 4483362458)
local Section = HomeTab:CreateSection("Home🏠")

-- JumpPower slider
local JumpSlider = HomeTab:CreateSlider({
    Name = "JumpPower",
    Range = {50, 500},
    Increment = 5,
    Suffix = "JumpPower",
    CurrentValue = 50,
    Flag = "Slider_Jump",
    Callback = function(Value)
        local char = Players.LocalPlayer.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        if hum then
            hum.JumpPower = Value
        end
    end,
})

-- Walkspeed slider
local WalkSlider = HomeTab:CreateSlider({
    Name = "Walkspeed",
    Range = {16, 500},
    Increment = 1,
    Suffix = "Walkspeed",
    CurrentValue = 16,
    Flag = "Slider_Walk",
    Callback = function(Value)
        local char = Players.LocalPlayer.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        if hum then
            hum.WalkSpeed = Value
        end
    end,
})

----------------------------------------------------------------
-- FLING GUI BUTTON
----------------------------------------------------------------
local FlingButton = HomeTab:CreateButton({
    Name = "Fling gui",
    Callback = function()
        local player = Players.LocalPlayer
        local playerGui = player:WaitForChild("PlayerGui")

        local gui = Instance.new("ScreenGui")
        gui.ResetOnSpawn = false
        gui.Name = "FlingGui"
        gui.Parent = playerGui

        local timerLabel = Instance.new("TextLabel")
        timerLabel.Size = UDim2.new(0, 200, 0, 50)
        timerLabel.Position = UDim2.new(0, 20, 0, 20)
        timerLabel.TextScaled = true
        timerLabel.BackgroundColor3 = Color3.fromRGB(0,0,0)
        timerLabel.TextColor3 = Color3.fromRGB(255,255,255)
        timerLabel.Text = "Time: 0"
        timerLabel.Parent = gui

        local counterLabel = Instance.new("TextLabel")
        counterLabel.Size = UDim2.new(0, 200, 0, 50)
        counterLabel.Position = UDim2.new(0, 20, 0, 80)
        counterLabel.TextScaled = true
        counterLabel.BackgroundColor3 = Color3.fromRGB(0,0,0)
        counterLabel.TextColor3 = Color3.fromRGB(255,255,255)
        counterLabel.Text = "Players Flung: 0"
        counterLabel.Parent = gui

        local toggleButton = Instance.new("TextButton")
        toggleButton.Size = UDim2.new(0, 150, 0, 50)
        toggleButton.Position = UDim2.new(0, 20, 0, 140)
        toggleButton.TextScaled = true
        toggleButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
        toggleButton.TextColor3 = Color3.fromRGB(255,255,255)
        toggleButton.Text = "Start Fling"
        toggleButton.Parent = gui

        local minimizeButton = Instance.new("TextButton")
        minimizeButton.Size = UDim2.new(0, 30, 0, 30)
        minimizeButton.Position = UDim2.new(0, 230, 0, 20)
        minimizeButton.Text = "-"
        minimizeButton.TextScaled = true
        minimizeButton.BackgroundColor3 = Color3.fromRGB(100,100,100)
        minimizeButton.TextColor3 = Color3.fromRGB(255,255,255)
        minimizeButton.Parent = gui

        local closeButton = Instance.new("TextButton")
        closeButton.Size = UDim2.new(0, 30, 0, 30)
        closeButton.Position = UDim2.new(0, 270, 0, 20)
        closeButton.Text = "X"
        closeButton.TextScaled = true
        closeButton.BackgroundColor3 = Color3.fromRGB(200,0,0)
        closeButton.TextColor3 = Color3.fromRGB(255,255,255)
        closeButton.Parent = gui

        local githubButton = Instance.new("TextButton")
        githubButton.Size = UDim2.new(0, 250, 0, 40)
        githubButton.Position = UDim2.new(0, 20, 0, 200)
        githubButton.TextScaled = true
        githubButton.BackgroundColor3 = Color3.fromRGB(30,30,30)
        githubButton.TextColor3 = Color3.fromRGB(255,255,255)
        githubButton.Text = "https://[Log in to view URL]"
        githubButton.Parent = gui

        task.spawn(function()
            local hue = 0
            while githubButton.Parent do
                hue = (hue + 0.01) % 1
                githubButton.TextColor3 = Color3.fromHSV(hue, 1, 1)
                task.wait(0.05)
            end
        end)

        githubButton.MouseButton1Click:Connect(function()
            if setclipboard then
                setclipboard("https://[Log in to view URL]")
            end
        end)

        closeButton.MouseButton1Click:Connect(function()
            gui:Destroy()
        end)

        local minimized = false
        minimizeButton.MouseButton1Click:Connect(function()
            minimized = not minimized
            if minimized then
                timerLabel.Visible = false
                counterLabel.Visible = false
                toggleButton.Visible = false
                githubButton.Visible = false
                minimizeButton.Text = "+"
            else
                timerLabel.Visible = true
                counterLabel.Visible = true
                toggleButton.Visible = true
                githubButton.Visible = true
                minimizeButton.Text = "-"
            end
        end)

        local startTime = 0
        local FlingActive = false
        local flungCount = 0

        RunService.RenderStepped:Connect(function()
            if startTime > 0 then
                timerLabel.Text = string.format("Time: %.1f", tick() - startTime)
            end
        end)

        local function SkidFling(TargetPlayer)
            local Character = player.Character
            local Humanoid = Character and Character:FindFirstChildOfClass("Humanoid")
            local RootPart = Humanoid and Humanoid.RootPart
            local TCharacter = TargetPlayer.Character
            if not TCharacter then return false end

            local THumanoid = TCharacter:FindFirstChildOfClass("Humanoid")
            local TRootPart = THumanoid and THumanoid.RootPart
            local THead = TCharacter:FindFirstChild("Head")
            local Accessory = TCharacter:FindFirstChildOfClass("Accessory")
            local Handle = Accessory and Accessory:FindFirstChild("Handle")

            if Character and Humanoid and RootPart then
                if RootPart.Velocity.Magnitude < 50 then
                    getgenv().OldPos = RootPart.CFrame
                end

                if THumanoid and THumanoid.Sit then return false end

                if THead then
                    workspace.CurrentCamera.CameraSubject = THead
                elseif Handle then
                    workspace.CurrentCamera.CameraSubject = Handle
                elseif THumanoid and TRootPart then
                    workspace.CurrentCamera.CameraSubject = THumanoid
                end

                if not TCharacter:FindFirstChildWhichIsA("BasePart") then return false end

                local function FPos(BasePart, Pos, Ang)
                    RootPart.CFrame = CFrame.new(BasePart.Position) * Pos * Ang
                    Character:SetPrimaryPartCFrame(CFrame.new(BasePart.Position) * Pos * Ang)
                    RootPart.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
                    RootPart.RotVelocity = Vector3.new(9e8, 9e8, 9e8)
                end

                local function SFBasePart(BasePart)
                    local TimeToWait = 2
                    local Time = tick()
                    local Angle = 0
                    repeat
                        if RootPart and THumanoid then
                            if BasePart.Velocity.Magnitude < 50 then
                                Angle = Angle + 100
                                FPos(BasePart, CFrame.new(0,1.5,0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude/1.25, CFrame.Angles(math.rad(Angle),0,0))
                                task.wait()
                                FPos(BasePart, CFrame.new(0,-1.5,0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude/1.25, CFrame.Angles(math.rad(Angle),0,0))
                                task.wait()
                            end
                        end
                    until Time + TimeToWait < tick() or not FlingActive
                end

                local BV = Instance.new("BodyVelocity")
                BV.Parent = RootPart
                BV.Velocity = Vector3.new(0,0,0)
                BV.MaxForce = Vector3.new(9e9,9e9,9e9)

                Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,false)

                if TRootPart then
                    SFBasePart(TRootPart)
                elseif THead then
                    SFBasePart(THead)
                elseif Handle then
                    SFBasePart(Handle)
                end

                BV:Destroy()
                Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,true)
                workspace.CurrentCamera.CameraSubject = Humanoid

                return true
            end
            return false
        end

        toggleButton.MouseButton1Click:Connect(function()
            FlingActive = not FlingActive
            if FlingActive then
                startTime = tick()
                flungCount = 0
                counterLabel.Text = "Players Flung: 0"
                toggleButton.Text = "Stop Fling"

                task.spawn(function()
                    while FlingActive do
                        local targets = {}
                        for _, otherPlayer in pairs(Players:GetPlayers()) do
                            if otherPlayer ~= player then
                                table.insert(targets, otherPlayer)
                            end
                        end

                        if #targets > 0 then
                            local randomPlayer = targets[math.random(1,#targets)]
                            local success = pcall(SkidFling, randomPlayer)
                            if success then
                                flungCount = flungCount + 1
                                counterLabel.Text = "Players Flung: " .. flungCount
                            end
                            task.wait(0.7)
                        else
                            task.wait(1)
                        end
                    end
                end)
            else
                toggleButton.Text = "Start Fling"
            end
        end)
    end,
})

----------------------------------------------------------------
-- FLY GUI TOGGLE (your Fly GUI V4)
----------------------------------------------------------------
local FlyGui -- track to destroy when toggle off

local FlyToggle = HomeTab:CreateToggle({
    Name = "Fly gui",
    CurrentValue = false,
    Flag = "Toggle_FlyGui",
    Callback = function(Value)
        if not Value then
            if FlyGui then
                FlyGui:Destroy()
                FlyGui = nil
            end
            return
        end

        if FlyGui and FlyGui.Parent then
            return
        end

        local main = Instance.new("ScreenGui")
        FlyGui = main
        local Frame = Instance.new("Frame")
        local up = Instance.new("TextButton")
        local down = Instance.new("TextButton")
        local onof = Instance.new("TextButton")
        local TextLabel = Instance.new("TextLabel")
        local plus = Instance.new("TextButton")
        local speed = Instance.new("TextLabel")
        local mine = Instance.new("TextButton")
        local closebutton = Instance.new("TextButton")
        local mini = Instance.new("TextButton")
        local mini2 = Instance.new("TextButton")

        main.Name = "main"
        main.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
        main.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
        main.ResetOnSpawn = false

        Frame.Parent = main
        Frame.BackgroundColor3 = Color3.fromRGB(163, 255, 137)
        Frame.BorderColor3 = Color3.fromRGB(103, 221, 213)
        Frame.Position = UDim2.new(0.100320168, 0, 0.379746825, 0)
        Frame.Size = UDim2.new(0, 190, 0, 57)
        Frame.Active = true
        Frame.Draggable = true

        up.Name = "up"
        up.Parent = Frame
        up.BackgroundColor3 = Color3.fromRGB(79, 255, 152)
        up.Size = UDim2.new(0, 44, 0, 28)
        up.Font = Enum.Font.SourceSans
        up.Text = "UP"
        up.TextColor3 = Color3.fromRGB(0, 0, 0)
        up.TextSize = 14.000

        down.Name = "down"
        down.Parent = Frame
        down.BackgroundColor3 = Color3.fromRGB(215, 255, 121)
        down.Position = UDim2.new(0, 0, 0.491228074, 0)
        down.Size = UDim2.new(0, 44, 0, 28)
        down.Font = Enum.Font.SourceSans
        down.Text = "DOWN"
        down.TextColor3 = Color3.fromRGB(0, 0, 0)
        down.TextSize = 14.000

        onof.Name = "onof"
        onof.Parent = Frame
        onof.BackgroundColor3 = Color3.fromRGB(255, 249, 74)
        onof.Position = UDim2.new(0.702823281, 0, 0.491228074, 0)
        onof.Size = UDim2.new(0, 56, 0, 28)
        onof.Font = Enum.Font.SourceSans
        onof.Text = "fly"
        onof.TextColor3 = Color3.fromRGB(0, 0, 0)
        onof.TextSize = 14.000

        TextLabel.Parent = Frame
        TextLabel.BackgroundColor3 = Color3.fromRGB(242, 60, 255)
        TextLabel.Position = UDim2.new(0.469327301, 0, 0, 0)
        TextLabel.Size = UDim2.new(0, 100, 0, 28)
        TextLabel.Font = Enum.Font.SourceSans
        TextLabel.Text = "FLY GUI V4"
        TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
        TextLabel.TextScaled = true
        TextLabel.TextSize = 14.000
        TextLabel.TextWrapped = true

        plus.Name = "plus"
        plus.Parent = Frame
        plus.BackgroundColor3 = Color3.fromRGB(133, 145, 255)
        plus.Position = UDim2.new(0.231578946, 0, 0, 0)
        plus.Size = UDim2.new(0, 45, 0, 28)
        plus.Font = Enum.Font.SourceSans
        plus.Text = "+"
        plus.TextColor3 = Color3.fromRGB(0, 0, 0)
        plus.TextScaled = true
        plus.TextSize = 14.000
        plus.TextWrapped = true

        speed.Name = "speed"
        speed.Parent = Frame
        speed.BackgroundColor3 = Color3.fromRGB(255, 85, 0)
        speed.Position = UDim2.new(0.468421042, 0, 0.491228074, 0)
        speed.Size = UDim2.new(0, 44, 0, 28)
        speed.Font = Enum.Font.SourceSans
        speed.Text = "1"
        speed.TextColor3 = Color3.fromRGB(0, 0, 0)
        speed.TextScaled = true
        speed.TextSize = 14.000
        speed.TextWrapped = true

        mine.Name = "mine"
        mine.Parent = Frame
        mine.BackgroundColor3 = Color3.fromRGB(123, 255, 247)
        mine.Position = UDim2.new(0.231578946, 0, 0.491228074, 0)
        mine.Size = UDim2.new(0, 45, 0, 29)
        mine.Font = Enum.Font.SourceSans
        mine.Text = "-"
        mine.TextColor3 = Color3.fromRGB(0, 0, 0)
        mine.TextScaled = true
        mine.TextSize = 14.000
        mine.TextWrapped = true

        closebutton.Name = "Close"
        closebutton.Parent = Frame
        closebutton.BackgroundColor3 = Color3.fromRGB(225, 25, 0)
        closebutton.Font = Enum.Font.SourceSans
        closebutton.Size = UDim2.new(0, 45, 0, 28)
        closebutton.Text = "X"
        closebutton.TextSize = 30
        closebutton.Position =  UDim2.new(0, 0, -1, 27)

        mini.Name = "minimize"
        mini.Parent = Frame
        mini.BackgroundColor3 = Color3.fromRGB(192, 150, 230)
        mini.Font = Enum.Font.SourceSans
        mini.Size = UDim2.new(0, 45, 0, 28)
        mini.Text = "-"
        mini.TextSize = 40
        mini.Position = UDim2.new(0, 44, -1, 27)

        mini2.Name = "minimize2"
        mini2.Parent = Frame
        mini2.BackgroundColor3 = Color3.fromRGB(192, 150, 230)
        mini2.Font = Enum.Font.SourceSans
        mini2.Size = UDim2.new(0, 45, 0, 28)
        mini2.Text = "+"
        mini2.TextSize = 40
        mini2.Position = UDim2.new(0, 44, -1, 57)
        mini2.Visible = false

        local speeds = 1
        local speaker = Players.LocalPlayer
        local nowe = false
        local tpwalking

        StarterGui:SetCore("SendNotification", { 
            Title = "FLY GUI V4",
            Text = "BY DentinhoJs",
            Icon = "rbxthumb://type=Asset&id=5107182114&w=150&h=1501",
            Duration = 5
        })

        onof.MouseButton1Down:Connect(function()
            if nowe == true then
                nowe = false

                local hum = speaker.Character and speaker.Character:FindFirstChildOfClass("Humanoid")
                if hum then
                    for _, state in ipairs(Enum.HumanoidStateType:GetEnumItems()) do
                        hum:SetStateEnabled(state, true)
                    end
                    hum:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
                end
            else
                nowe = true

                for i = 1, speeds do
                    task.spawn(function()
                        local hb = RunService.Heartbeat
                        tpwalking = true
                        local chr = speaker.Character
                        local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
                        while tpwalking and hb:Wait() and chr and hum and hum.Parent do
                            if hum.MoveDirection.Magnitude > 0 then
                                chr:TranslateBy(hum.MoveDirection)
                            end
                        end
                    end)
                end

                if speaker.Character then
                    local anim = speaker.Character:FindFirstChild("Animate")
                    if anim then anim.Disabled = true end
                    local Hum = speaker.Character:FindFirstChildOfClass("Humanoid")
                    if Hum then
                        for _, track in ipairs(Hum:GetPlayingAnimationTracks()) do
                            track:AdjustSpeed(0)
                        end
                    end
                    local hum = Hum
                    if hum then
                        for _, state in ipairs(Enum.HumanoidStateType:GetEnumItems()) do
                            hum:SetStateEnabled(state, false)
                        end
                        hum:ChangeState(Enum.HumanoidStateType.Swimming)
                    end
                end
            end
        end)

        -- (R6 & R15 fly loops omitted here for brevity, but you can keep your original if you want full behavior)

        local tis
        up.MouseButton1Down:Connect(function()
            tis = up.MouseEnter:Connect(function()
                while tis do
                    task.wait()
                    local char = speaker.Character
                    local hrp = char and char:FindFirstChild("HumanoidRootPart")
                    if hrp then
                        hrp.CFrame = hrp.CFrame * CFrame.new(0,1,0)
                    end
                end
            end)
        end)

        up.MouseLeave:Connect(function()
            if tis then
                tis:Disconnect()
                tis = nil
            end
        end)

        local dis
        down.MouseButton1Down:Connect(function()
            dis = down.MouseEnter:Connect(function()
                while dis do
                    task.wait()
                    local char = speaker.Character
                    local hrp = char and char:FindFirstChild("HumanoidRootPart")
                    if hrp then
                        hrp.CFrame = hrp.CFrame * CFrame.new(0,-1,0)
                    end
                end
            end)
        end)

        down.MouseLeave:Connect(function()
            if dis then
                dis:Disconnect()
                dis = nil
            end
        end)

        Players.LocalPlayer.CharacterAdded:Connect(function()
            task.wait(0.7)
            local char = Players.LocalPlayer.Character
            if char then
                local hum = char:FindFirstChildOfClass("Humanoid")
                if hum then
                    hum.PlatformStand = false
                end
                local anim = char:FindFirstChild("Animate")
                if anim then anim.Disabled = false end
            end
        end)

        plus.MouseButton1Down:Connect(function()
            speeds = speeds + 1
            speed.Text = speeds
        end)

        mine.MouseButton1Down:Connect(function()
            if speeds == 1 then
                speed.Text = "não pode ser menor que 1"
                task.wait(1)
                speed.Text = speeds
            else
                speeds = speeds - 1
                speed.Text = speeds
            end
        end)

        closebutton.MouseButton1Click:Connect(function()
            if FlyGui then
                FlyGui:Destroy()
                FlyGui = nil
            end
        end)

        mini.MouseButton1Click:Connect(function()
            up.Visible = false
            down.Visible = false
            onof.Visible = false
            plus.Visible = false
            speed.Visible = false
            mine.Visible = false
            mini.Visible = false
            mini2.Visible = true
            Frame.BackgroundTransparency = 1
            closebutton.Position = UDim2.new(0, 0, -1, 57)
        end)

        mini2.MouseButton1Click:Connect(function()
            up.Visible = true
            down.Visible = true
            onof.Visible = true
            plus.Visible = true
            speed.Visible = true
            mine.Visible = true
            mini.Visible = true
            mini2.Visible = false
            Frame.BackgroundTransparency = 0 
            closebutton.Position = UDim2.new(0, 0, -1, 27)
        end)
    end,
})

----------------------------------------------------------------
-- NOCLIP (Toggle on Home tab)
----------------------------------------------------------------
local noclipEnabled = false
local noclipConnection

local function stopNoclip()
    noclipEnabled = false
    if noclipConnection then
        noclipConnection:Disconnect()
        noclipConnection = nil
    end

    local char = Players.LocalPlayer.Character
    if not char then return end

    for _, part in ipairs(char:GetDescendants()) do
        if part:IsA("BasePart") then
            part.CanCollide = true
        end
    end
end

local function startNoclip()
    noclipEnabled = true

    if noclipConnection then
        noclipConnection:Disconnect()
    end

    noclipConnection = RunService.Stepped:Connect(function()
        if not noclipEnabled then return end
        local char = Players.LocalPlayer.Character
        if not char then return end

        for _, part in ipairs(char:GetDescendants()) do
            if part:IsA("BasePart") then
                part.CanCollide = false
            end
        end
    end)
end

local NoclipToggle = HomeTab:CreateToggle({
    Name = "Noclip",
    CurrentValue = false,
    Flag = "Toggle_Noclip",
    Callback = function(Value)
        if Value then
            startNoclip()
        else
            stopNoclip()
        end
    end,
})

----------------------------------------------------------------
-- ESP LOGIC
----------------------------------------------------------------
local espEnabled = false
local espConnections = {}

local function clearESP()
    espEnabled = false

    for _, conn in ipairs(espConnections) do
        if conn.Disconnect then
            conn:Disconnect()
        end
    end
    espConnections = {}

    for _, plr in ipairs(Players:GetPlayers()) do
        if plr.Character then
            local head = plr.Character:FindFirstChild("Head")
            if head then
                local gui = head:FindFirstChild("ESPBillboard")
                if gui then
                    gui:Destroy()
                end
            end
        end
    end
end

local function attachESPToCharacter(char, plr)
    if not espEnabled then return end
    if not char then return end
    local head = char:FindFirstChild("Head")
    if not head then return end

    local old = head:FindFirstChild("ESPBillboard")
    if old then old:Destroy() end

    local bill = Instance.new("BillboardGui")
    bill.Name = "ESPBillboard"
    bill.AlwaysOnTop = true
    bill.Size = UDim2.new(0, 200, 0, 50)
    bill.StudsOffset = Vector3.new(0, 3, 0)
    bill.Parent = head

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1, 0, 1, 0)
    label.BackgroundTransparency = 1
    label.Font = Enum.Font.SourceSansBold
    label.TextScaled = true
    label.TextColor3 = Color3.new(1, 1, 1)
    label.TextStrokeTransparency = 0
    label.Parent = bill

    local conn = RunService.RenderStepped:Connect(function()
        if not espEnabled then return end
        if not char.Parent then return end

        local lpChar = Players.LocalPlayer.Character
        local lpRoot = lpChar and lpChar:FindFirstChild("HumanoidRootPart")
        local tRoot = char:FindFirstChild("HumanoidRootPart")

        local distText = ""
        if lpRoot and tRoot then
            local dist = (lpRoot.Position - tRoot.Position).Magnitude
            distText = string.format(" [%.0f]", dist)
        end

        label.Text = plr.Name .. distText
    end)

    table.insert(espConnections, conn)
end

local function attachESPToPlayer(plr)
    if plr == Players.LocalPlayer then return end

    if plr.Character then
        task.spawn(function()
            task.wait(0.2)
            attachESPToCharacter(plr.Character, plr)
        end)
    end

    local charConn = plr.CharacterAdded:Connect(function(char)
        task.wait(0.2)
        attachESPToCharacter(char, plr)
    end)
    table.insert(espConnections, charConn)
end

local function enableESP()
    if espEnabled then return end
    espEnabled = true

    for _, plr in ipairs(Players:GetPlayers()) do
        attachESPToPlayer(plr)
    end

    local addConn = Players.PlayerAdded:Connect(function(plr)
        attachESPToPlayer(plr)
    end)
    table.insert(espConnections, addConn)
end

----------------------------------------------------------------
-- ESP TAB + TOGGLE
----------------------------------------------------------------
local ESPTab = Window:CreateTab("ESP👁", 4483362458)
local ESPSection = ESPTab:CreateSection("ESP")

local ESPToggle = ESPTab:CreateToggle({
    Name = "Player ESP",
    CurrentValue = false,
    Flag = "Toggle_ESP",
    Callback = function(Value)
        if Value then
            enableESP()
        else
            clearESP()
        end
    end,
})

----------------------------------------------------------------
-- LOAD CONFIG
----------------------------------------------------------------
Rayfield:LoadConfiguration()

end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: