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",
   Theme = "Default",
   DisableRayfieldPrompts = false,
   DisableBuildWarnings = false,
   ConfigurationSaving = {
      Enabled = true,
      FolderName = nil,
      FileName = "Big Hub"
   },
   Discord = {
      Enabled = false,
      Invite = "noinvitelink",
      RememberJoins = true
   },
   KeySystem = false,
   KeySettings = {
      Title = "Untitled",
      Subtitle = "Key System",
      Note = "No method of obtaining the key is provided",
      FileName = "Key",
      SaveKey = true,
      GrabKeyFromSite = false,
      Key = {"Hello"}
   }
})

local ESPTab = Window:CreateTab("ESP", 4483362458)
local ESPSection = ESPTab:CreateSection("Test Esps")

local settings = {
    defaultcolor = Color3.fromRGB(255, 0, 0),
    teamcolor = true,
    espEnabled = false
}

local runService = game:GetService("RunService")
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local camera = workspace.CurrentCamera

local newVector2, newColor3, newDrawing = Vector2.new, Color3.new, Drawing.new
local tan, rad = math.tan, math.rad
local round = function(...) local a = {}; for i,v in next, table.pack(...) do a[i] = math.round(v); end return unpack(a); end
local wtvp = function(...) local a, b = camera.WorldToViewportPoint(camera, ...) return newVector2(a.X, a.Y), b, a.Z end

local espCache = {}
local function createEsp(player)
    local drawings = {}
    drawings.box = newDrawing("Square")
    drawings.box.Thickness = 1
    drawings.box.Filled = false
    drawings.box.Color = settings.defaultcolor
    drawings.box.Visible = false
    drawings.box.ZIndex = 2

    drawings.boxoutline = newDrawing("Square")
    drawings.boxoutline.Thickness = 3
    drawings.boxoutline.Filled = false
    drawings.boxoutline.Color = newColor3()
    drawings.boxoutline.Visible = false
    drawings.boxoutline.ZIndex = 1

    espCache[player] = drawings
end

local function removeEsp(player)
    if rawget(espCache, player) then
        for _, drawing in next, espCache[player] do
            drawing:Remove()
        end
        espCache[player] = nil
    end
end

local function updateEsp(player, esp)
    local character = player and player.Character
    if character then
        local cframe = character:GetModelCFrame()
        local position, visible, depth = wtvp(cframe.Position)
        esp.box.Visible = visible and settings.espEnabled
        esp.boxoutline.Visible = visible and settings.espEnabled

        if cframe and visible then
            local scaleFactor = 1 / (depth * tan(rad(camera.FieldOfView / 2)) * 2) * 1000
            local width, height = round(4 * scaleFactor, 5 * scaleFactor)
            local x, y = round(position.X, position.Y)

            esp.box.Size = newVector2(width, height)
            esp.box.Position = newVector2(round(x - width / 2, y - height / 2))
            esp.box.Color = settings.teamcolor and player.TeamColor.Color or settings.defaultcolor

            esp.boxoutline.Size = esp.box.Size
            esp.boxoutline.Position = esp.box.Position
        end
    else
        esp.box.Visible = false
        esp.boxoutline.Visible = false
    end
end

ESPTab:CreateToggle({
    Name = "Enable Box Esp",
    CurrentValue = settings.espEnabled,
    Flag = "espToggle",
    Callback = function(value)
        settings.espEnabled = value
    end
})

for _, player in next, players:GetPlayers() do
    if player ~= localPlayer then
        createEsp(player)
    end
end

players.PlayerAdded:Connect(function(player)
    createEsp(player)
end)

players.PlayerRemoving:Connect(function(player)
    removeEsp(player)
end)

runService:BindToRenderStep("esp", Enum.RenderPriority.Camera.Value, function()
    for player, drawings in next, espCache do
        if drawings and player ~= localPlayer then
            updateEsp(player, drawings)
        end
    end
end)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer

local skeletonESPEnabled = false
local skeletonColor = Color3.fromRGB(255, 255, 255)

local function createLine()
    local line = Drawing.new("Line")
    line.Thickness = 1
    line.Color = skeletonColor
    line.Transparency = 1
    line.Visible = false
    return line
end

local skeletons = {}

local function setupPlayer(player)
    if player == LocalPlayer then return end
    skeletons[player] = {
        headToTorso = createLine(),
        torsoToLeftArm = createLine(),
        torsoToRightArm = createLine(),
        torsoToLeftLeg = createLine(),
        torsoToRightLeg = createLine(),
    }
end

local function removePlayer(player)
    if skeletons[player] then
        for _, line in pairs(skeletons[player]) do
            line:Remove()
        end
        skeletons[player] = nil
    end
end

for _, player in pairs(Players:GetPlayers()) do
    setupPlayer(player)
end

Players.PlayerAdded:Connect(setupPlayer)
Players.PlayerRemoving:Connect(removePlayer)

RunService.RenderStepped:Connect(function()
    if not skeletonESPEnabled then return end

    for player, lines in pairs(skeletons) do
        local char = player.Character
        if char and char:FindFirstChild("HumanoidRootPart") and char:FindFirstChild("Head") then
            local parts = {
                head = char:FindFirstChild("Head"),
                torso = char:FindFirstChild("HumanoidRootPart"),
                leftArm = char:FindFirstChild("LeftUpperArm") or char:FindFirstChild("Left Arm"),
                rightArm = char:FindFirstChild("RightUpperArm") or char:FindFirstChild("Right Arm"),
                leftLeg = char:FindFirstChild("LeftUpperLeg") or char:FindFirstChild("Left Leg"),
                rightLeg = char:FindFirstChild("RightUpperLeg") or char:FindFirstChild("Right Leg"),
            }

            local function toScreen(part)
                local pos, onScreen = Camera:WorldToViewportPoint(part.Position)
                return Vector2.new(pos.X, pos.Y), onScreen
            end

            local headPos, onScreen1 = toScreen(parts.head)
            local torsoPos, onScreen2 = toScreen(parts.torso)

            lines.headToTorso.Visible = onScreen1 and onScreen2
            if lines.headToTorso.Visible then
                lines.headToTorso.From = headPos
                lines.headToTorso.To = torsoPos
            end

            local function connectLimb(line, from, to)
                if from and to then
                    local fromPos, onScreenFrom = toScreen(from)
                    local toPos, onScreenTo = toScreen(to)
                    line.Visible = onScreenFrom and onScreenTo
                    if line.Visible then
                        line.From = fromPos
                        line.To = toPos
                    end
                else
                    line.Visible = false
                end
            end

            connectLimb(lines.torsoToLeftArm, parts.torso, parts.leftArm)
            connectLimb(lines.torsoToRightArm, parts.torso, parts.rightArm)
            connectLimb(lines.torsoToLeftLeg, parts.torso, parts.leftLeg)
            connectLimb(lines.torsoToRightLeg, parts.torso, parts.rightLeg)
        else
            for _, line in pairs(lines) do
                line.Visible = false
            end
        end
    end
end)

ESPTab:CreateToggle({
    Name = "Enable Skeleton Esp",
    CurrentValue = false,
    Flag = "SkeletonESPEnabled",
    Callback = function(state)
        skeletonESPEnabled = state
        for _, lines in pairs(skeletons) do
            for _, line in pairs(lines) do
                line.Visible = state
            end
        end
    end
})

local highlightEnabled = false
local heartbeatConnection = nil

local function highlightPlayers()
    for _, player in ipairs(Players:GetPlayers()) do
        if player.Character and player.Character:FindFirstChild("Humanoid") then
            if not player.Character:FindFirstChildOfClass("Highlight") then
                local highlight = Instance.new("Highlight")
                highlight.Parent = player.Character
                highlight.FillColor = Color3.fromRGB(255, 255, 255)
                highlight.FillTransparency = 0.5
                highlight.OutlineColor = Color3.fromRGB(0, 0, 0)
                highlight.OutlineTransparency = 0
            end
        end
    end
end

local function removeHighlights()
    for _, player in ipairs(Players:GetPlayers()) do
        if player.Character then
            local highlight = player.Character:FindFirstChildOfClass("Highlight")
            if highlight then
                highlight:Destroy()
            end
        end
    end
end

ESPTab:CreateToggle({
    Name = "Toggle Player Highlight",
    CurrentValue = highlightEnabled,
    Flag = "HighlightEnabled",
    Callback = function(value)
        highlightEnabled = value
        if highlightEnabled then
            if not heartbeatConnection then
                heartbeatConnection = RunService.Heartbeat:Connect(highlightPlayers)
            end
        else
            if heartbeatConnection then
                heartbeatConnection:Disconnect()
                heartbeatConnection = nil
            end
            removeHighlights()
        end
    end
})

local TextColor = Color3.fromRGB(255, 255, 255)
local TextSize = 10

local function CreateESP()
    for _, v in next, Players:GetPlayers() do
        if v.Name ~= Players.LocalPlayer.Name then
            local ESP = Drawing.new("Text")

            RunService.RenderStepped:Connect(function()
                if workspace:FindFirstChild(v.Name) ~= nil and workspace[v.Name]:FindFirstChild("HumanoidRootPart") ~= nil then
                    local Vector, OnScreen = Camera:WorldToViewportPoint(workspace[v.Name]:WaitForChild("Head").Position)

                    ESP.Size = TextSize
                    ESP.Color = TextColor
                    ESP.Position = Vector2.new(Vector.X, Vector.Y - 25)
                    ESP.Text = v.Name
                    ESP.Visible = highlightEnabled
                else
                    ESP.Visible = false
                end
            end)

            Players.PlayerRemoving:Connect(function()
                ESP.Visible = false
            end)
        end
    end
end

RunService.Heartbeat:Connect(function()
    if highlightEnabled then
        highlightPlayers()
    end
end)

ESPTab:CreateToggle({
    Name = "Toggle ESP",
    Callback = function()
        highlightEnabled = not highlightEnabled
    end
})

CreateESP()

local ESPObjects = {}
local TracerEnabled = false

ESPTab:CreateToggle({
    Name = "Enable Tracers",
    CurrentValue = false,
    Callback = function(Value)
        TracerEnabled = Value
    end,
})

local function worldToScreen(pos)
    local screenPos, onScreen = camera:WorldToViewportPoint(pos)
    return Vector2.new(screenPos.X, screenPos.Y), onScreen
end

local function createTracer(v)
    if ESPObjects[v] then return end

    local tracer = Drawing.new("Line")
    tracer.Thickness = 1
    tracer.Color = Color3.fromRGB(255, 255, 255)
    tracer.Visible = false

    ESPObjects[v] = tracer
end

local function removeTracer(v)
    if ESPObjects[v] then
        ESPObjects[v]:Remove()
        ESPObjects[v] = nil
    end
end

runService.RenderStepped:Connect(function()
    for _, v in pairs(players:GetPlayers()) do
        if v ~= localPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
            local tracer = ESPObjects[v]
            if not tracer then
                createTracer(v)
                tracer = ESPObjects[v]
            end

            local rootPart = v.Character.HumanoidRootPart
            local screenPos, onScreen = worldToScreen(rootPart.Position)

            if TracerEnabled and onScreen then
                local screenBottom = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y - 10)
                tracer.From = screenBottom
                tracer.To = screenPos
                tracer.Color = v.TeamColor and v.TeamColor.Color or Color3.fromRGB(255, 255, 255)
                tracer.Visible = true
            else
                tracer.Visible = false
            end
        else
            removeTracer(v)
        end
    end
end)

players.PlayerRemoving:Connect(removeTracer)

Embed on website

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