LinoriaHeart V1
Key RequiredUniversal

LinoriaHeart V1

Universal Scripttennisballs9000tennisballs9000 1.4K views 11.3K executesUpdated Oct 1, 2026
2.5/ 5(4 votes)
2250% Positive
Lua Script•1594 lines (63769 chars)
-- Credits to tennisballs9000 on discord, dm me for suggestions
-- ==========================================
-- 1. RE-EXECUTION, UNLOAD & OLD UI CLEANUP
-- ==========================================
local Lighting = game:GetService("Lighting")
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local SoundService = game:GetService("SoundService")
local MarketplaceService = game:GetService("MarketplaceService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")
local StatsService = game:GetService("Stats")

local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()

-- Cache true original game settings on FIRST execution only
if _G.OriginalLighting == nil then
    _G.OriginalLighting = {
        Brightness = Lighting.Brightness,
        Ambient = Lighting.Ambient,
        GlobalShadows = Lighting.GlobalShadows,
        FogEnd = Lighting.FogEnd,
        FogStart = Lighting.FogStart,
    }
end
if _G.OriginalGravity == nil then _G.OriginalGravity = workspace.Gravity end
if _G.OriginalCameraMaxZoom == nil then _G.OriginalCameraMaxZoom = LocalPlayer.CameraMaxZoomDistance end
if _G.OriginalFallenPartsDestroyHeight == nil then _G.OriginalFallenPartsDestroyHeight = workspace.FallenPartsDestroyHeight end

local function getSafeGuiContainer()
    if typeof(gethui) == "function" then
        local success, result = pcall(gethui)
        if success and result then return result end
    end
    local success, coreGui = pcall(function() return game:GetService("CoreGui") end)
    if success and coreGui then return coreGui end
    return LocalPlayer:WaitForChild("PlayerGui")
end

local SafeGuiContainer = getSafeGuiContainer()

local function purgeOldUI()
    local targets = {SafeGuiContainer}
    pcall(function() table.insert(targets, game:GetService("CoreGui")) end)
    pcall(function() table.insert(targets, LocalPlayer:FindFirstChildOfClass("PlayerGui")) end)

    for _, container in ipairs(targets) do
        if container then
            for _, child in ipairs(container:GetChildren()) do
                if child:IsA("ScreenGui") and (
                    child.Name:lower():find("linoria") or 
                    child.Name:lower():find("universal") or 
                    child:FindFirstChild("Main") or 
                    child:FindFirstChild("ResizeGripHandle") or
                    child:FindFirstChild("Screen")
                ) then
                    pcall(function() child:Destroy() end)
                end
            end
        end
    end
end

-- If script was already executed, trigger full cleanup & unload LinoriaLib
if _G.UniversalHubCleanup then
    pcall(_G.UniversalHubCleanup)
end
if _G.UniversalHubLibrary then
    pcall(function() _G.UniversalHubLibrary:Unload() end)
    _G.UniversalHubLibrary = nil
end
purgeOldUI()

local connections = {}
local activeLoops = {true}

Lighting.GlobalShadows = true

-- Spectate Tracer Variables
local spectateBeam = nil
local spectateAtt0 = nil
local spectateAtt1 = nil

local function removeSpectateTracer()
    if spectateBeam then pcall(function() spectateBeam:Destroy() end) spectateBeam = nil end
    if spectateAtt0 then pcall(function() spectateAtt0:Destroy() end) spectateAtt0 = nil end
    if spectateAtt1 then pcall(function() spectateAtt1:Destroy() end) spectateAtt1 = nil end
end

-- Custom Highlight Containers
local customHighlightFolder = Instance.new("Folder")
customHighlightFolder.Name = "UniversalHub_CustomHighlights"
customHighlightFolder.Parent = workspace

local playerHighlights = {}
local npcHighlights = {}

local function clearAllCustomHighlights()
    if customHighlightFolder then
        customHighlightFolder:ClearAllChildren()
    end
    table.clear(playerHighlights)
    table.clear(npcHighlights)
end

_G.UniversalHubCleanup = function()
    activeLoops[1] = false
    
    for _, conn in ipairs(connections) do
        if conn and conn.Connected then
            conn:Disconnect()
        end
    end
    table.clear(connections)

    removeSpectateTracer()
    clearAllCustomHighlights()

    if customHighlightFolder then customHighlightFolder:Destroy() end

    if workspace:FindFirstChild("UniversalFloatPlatform") then
        workspace.UniversalFloatPlatform:Destroy()
    end

    -- Reset Camera State
    local cam = workspace.CurrentCamera
    if cam then
        cam.FieldOfView = 70
        if LocalPlayer.Character then
            local hum = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
            local hrp = LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
            if hum then cam.CameraSubject = hum elseif hrp then cam.CameraSubject = hrp end
        end
        cam.CameraType = Enum.CameraType.Custom
    end

    -- Reset Character Physics & Stats to Default
    if LocalPlayer.Character then
        local hum = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
        if hum then
            hum.WalkSpeed = 16
            hum.JumpPower = 50
            hum.UseJumpPower = true
            hum.MaxSlopeAngle = 45
        end
    end

    -- Restore Game Environment Settings
    if _G.OriginalLighting then
        Lighting.Brightness = _G.OriginalLighting.Brightness
        Lighting.Ambient = _G.OriginalLighting.Ambient
        Lighting.GlobalShadows = _G.OriginalLighting.GlobalShadows
        Lighting.FogEnd = _G.OriginalLighting.FogEnd
        Lighting.FogStart = _G.OriginalLighting.FogStart
    end

    if _G.OriginalGravity ~= nil then workspace.Gravity = _G.OriginalGravity end
    if _G.OriginalFallenPartsDestroyHeight ~= nil then workspace.FallenPartsDestroyHeight = _G.OriginalFallenPartsDestroyHeight end
    if _G.OriginalCameraMaxZoom ~= nil then LocalPlayer.CameraMaxZoomDistance = _G.OriginalCameraMaxZoom end

    -- Unload Linoria Library Instance
    if _G.UniversalHubLibrary then
        pcall(function() _G.UniversalHubLibrary:Unload() end)
        _G.UniversalHubLibrary = nil
    end

    purgeOldUI()
end

-- ==========================================
-- 2. EXECUTOR DETECTION & TELEMETRY SYSTEM
-- ==========================================
local executorName = "Unknown"
pcall(function()
    if identifyexecutor then
        executorName = identifyexecutor()
    elseif getexecutorname then
        executorName = getexecutorname()
    end
end)

local telemetryData = {
    Enabled = true,
    PlaceId = game.PlaceId,
    GameId = game.GameId,
    GameName = "Unknown",
    Executor = executorName,
    SessionStart = os.time(),
    FeatureUsage = {}
}

task.spawn(function()
    pcall(function()
        local info = MarketplaceService:GetProductInfo(game.PlaceId)
        if info and info.Name then
            telemetryData.GameName = info.Name
        end
    end)
end)

local function trackFeature(featureName)
    if not telemetryData.Enabled then return end
    telemetryData.FeatureUsage[featureName] = (telemetryData.FeatureUsage[featureName] or 0) + 1
end

-- ==========================================
-- 3. CORE VARIABLES & STATE
-- ==========================================
local walkSpeedValue = 16
local jumpPowerValue = 50
local fovValue = 70

local customCameraZoomEnabled = true
local customCameraZoomValue = 1280

local tpToolEnabled = false
local floatEnabled = false
local qeControlEnabled = true
local floatSpeedValue = 42
local floatBaseY = nil
local floatYOffset = 0

local potatoGraphicsEnabled = false
local fullbrightEnabled = false
local noFogEnabled = false

local customGravityEnabled = false
local customGravityValue = math.floor(_G.OriginalGravity)
local disableSlidingEnabled = false

local joinLogEnabled = false
local playerJoinTimes = {}

local lowHpTrackerEnabled = false
local deathListenerEnabled = false
local deathLogs = {}
local lowHpDebounce = {}

local spectatingPlayer = nil
local selectedTpPlayer = nil

-- Latch Onto Mechanics
local latchOntoEnabled = false
local ogLatchLocation = nil
local lastLatchedTarget = nil

local waypointsList = {}
local selectedWaypointName = nil

local playerTextOffsetY = 2.5

local soundSettings = {
    LowHP = { Volume = 0.5, SoundId = "rbxassetid://4590657391" },
    PlayerLeft = { Volume = 0.5, SoundId = "rbxassetid://9114220737" },
    General = { Volume = 0.5, SoundId = "rbxassetid://9060817403" }
}

local function playCustomSound(category)
    pcall(function()
        local cfg = soundSettings[category] or soundSettings.General
        local sound = Instance.new("Sound")
        sound.SoundId = cfg.SoundId
        sound.Volume = cfg.Volume
        sound.Parent = SoundService
        sound:Play()
        game:GetService("Debris"):AddItem(sound, 3)
    end)
end

local leaveNotifQueue = {}
local isProcessingLeaveQueue = false

local function processLeaveNotificationQueue(Library)
    if isProcessingLeaveQueue then return end
    isProcessingLeaveQueue = true
    task.spawn(function()
        while #leaveNotifQueue > 0 and activeLoops[1] do
            local msg = table.remove(leaveNotifQueue, 1)
            playCustomSound("PlayerLeft")
            if Library then
                Library:Notify("Player Left: " .. msg, 4)
            end
            task.wait(0.8)
        end
        isProcessingLeaveQueue = false
    end)
end

for _, player in ipairs(Players:GetPlayers()) do
    playerJoinTimes[player] = tick()
end

table.insert(connections, Players.PlayerAdded:Connect(function(player)
    playerJoinTimes[player] = tick()
end))

local originalMaterials = {}
task.spawn(function()
    local parts = Workspace:GetDescendants()
    for i = 1, #parts do
        local part = parts[i]
        if part:IsA("BasePart") then
            originalMaterials[part] = part.Material
        end
        if i % 200 == 0 then task.wait() end
    end
end)

-- ==========================================
-- 4. AUTO ERROR RECOVERY & GARBAGE CLEANER
-- ==========================================
local loopHeartbeats = {
    render = tick(),
    heartbeat = tick(),
    npcScan = tick()
}

task.spawn(function()
    while activeLoops[1] do
        task.wait(60)
        pcall(function()
            for part in pairs(originalMaterials) do
                if not part or not part.Parent then
                    originalMaterials[part] = nil
                end
            end
            for player in pairs(playerJoinTimes) do
                if not player or not player.Parent then
                    playerJoinTimes[player] = nil
                end
            end
            for player, data in pairs(playerHighlights) do
                if not player or not player.Parent then
                    if data.highlight then pcall(function() data.highlight:Destroy() end) end
                    if data.billboard then pcall(function() data.billboard:Destroy() end) end
                    playerHighlights[player] = nil
                end
            end
            for npc, data in pairs(npcHighlights) do
                if not npc or not npc.Parent then
                    if data.highlight then pcall(function() data.highlight:Destroy() end) end
                    if data.billboard then pcall(function() data.billboard:Destroy() end) end
                    npcHighlights[npc] = nil
                end
            end
            while #deathLogs > 100 do
                table.remove(deathLogs)
            end
            collectgarbage("collect")
        end)
    end
end)

task.spawn(function()
    while activeLoops[1] do
        task.wait(5)
        pcall(function()
            local now = tick()
            for name, lastTick in pairs(loopHeartbeats) do
                if now - lastTick > 10 then
                    loopHeartbeats[name] = now
                end
            end
        end)
    end
end)

local function getGameSpawnLocation()
    if LocalPlayer.RespawnLocation and LocalPlayer.RespawnLocation:IsA("BasePart") then
        return LocalPlayer.RespawnLocation.CFrame + Vector3.new(0, 3, 0)
    end
    for _, desc in ipairs(Workspace:GetDescendants()) do
        if desc:IsA("SpawnLocation") and desc.Enabled then
            return desc.CFrame + Vector3.new(0, 3, 0)
        end
    end
    return nil
end

local function giveTeleportTool()
    local char = LocalPlayer.Character
    if not char then return end
    local backpack = LocalPlayer:FindFirstChildOfClass("Backpack")
    if not backpack or backpack:FindFirstChild("Teleport Tool") or char:FindFirstChild("Teleport Tool") then return end

    local tool = Instance.new("Tool")
    tool.Name = "Teleport Tool"
    tool.RequiresHandle = false

    tool.Activated:Connect(function()
        local hrp = char:FindFirstChild("HumanoidRootPart")
        if hrp and Mouse.Hit then
            local currentRotation = hrp.CFrame - hrp.CFrame.Position
            hrp.CFrame = CFrame.new(Mouse.Hit.Position + Vector3.new(0, 3, 0)) * currentRotation
        end
    end)

    tool.Parent = backpack
end

local floatPlatform = nil
local function updateFloatPlatform(dt)
    if not floatEnabled then
        if floatPlatform then floatPlatform:Destroy() floatPlatform = nil end
        floatBaseY = nil
        return
    end

    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    local hum = char and char:FindFirstChildOfClass("Humanoid")

    if hrp and hum then
        local hipOffset = (hum.RigType == Enum.HumanoidRigType.R15) and (hum.HipHeight + 1.2) or 3.0
        local targetY = hrp.Position.Y - hipOffset

        if not floatBaseY or math.abs(targetY - floatBaseY) > 15 then
            floatBaseY = targetY
        end

        local verticalSpeed = floatSpeedValue * dt
        if qeControlEnabled then
            if UserInputService:IsKeyDown(Enum.KeyCode.E) then
                hrp.CFrame = hrp.CFrame + Vector3.new(0, verticalSpeed, 0)
                floatBaseY = floatBaseY + verticalSpeed
            elseif UserInputService:IsKeyDown(Enum.KeyCode.Q) then
                hrp.CFrame = hrp.CFrame - Vector3.new(0, verticalSpeed, 0)
                floatBaseY = floatBaseY - verticalSpeed
            end
        end

        if not floatPlatform or not floatPlatform.Parent then
            floatPlatform = Instance.new("Part")
            floatPlatform.Name = "UniversalFloatPlatform"
            floatPlatform.Size = Vector3.new(6, 1, 6)
            floatPlatform.Anchored = true
            floatPlatform.CanCollide = true
            floatPlatform.Transparency = 0.9
            floatPlatform.Material = Enum.Material.ForceField
            floatPlatform.Color = Color3.fromRGB(0, 170, 255)
            floatPlatform.Parent = Workspace
        end
        
        floatPlatform.CFrame = CFrame.new(hrp.Position.X, floatBaseY + floatYOffset, hrp.Position.Z)
    end
end

local function stopSpectating()
    spectatingPlayer = nil
    removeSpectateTracer()
    local cam = Workspace.CurrentCamera
    local char = LocalPlayer.Character
    if cam and char then
        local hum = char:FindFirstChildOfClass("Humanoid")
        local hrp = char:FindFirstChild("HumanoidRootPart")
        if hum then cam.CameraSubject = hum elseif hrp then cam.CameraSubject = hrp end
        cam.CameraType = Enum.CameraType.Custom
    end
end

local function updateSpectateTracer()
    if not spectatingPlayer or not spectatingPlayer.Character or not LocalPlayer.Character then
        removeSpectateTracer()
        return
    end

    local myHRP = LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    local targetHRP = spectatingPlayer.Character:FindFirstChild("HumanoidRootPart")
    if not myHRP or not targetHRP then removeSpectateTracer() return end

    if not spectateBeam or not spectateBeam.Parent then
        removeSpectateTracer()
        
        spectateAtt0 = Instance.new("Attachment") spectateAtt0.Parent = myHRP
        spectateAtt1 = Instance.new("Attachment") spectateAtt1.Parent = targetHRP

        spectateBeam = Instance.new("Beam")
        spectateBeam.Attachment0 = spectateAtt0
        spectateBeam.Attachment1 = spectateAtt1
        spectateBeam.Color = ColorSequence.new(Color3.fromRGB(0, 255, 170))
        spectateBeam.Width0 = 0.08
        spectateBeam.Width1 = 0.08
        spectateBeam.FaceCamera = true
        spectateBeam.LightEmission = 1
        spectateBeam.Parent = myHRP
    else
        if spectateAtt1 and spectateAtt1.Parent ~= targetHRP then
            spectateAtt1.Parent = targetHRP
        end
    end
end

-- ==========================================
-- 5. LINORIA LIBRARY SETUP & UI ENHANCEMENTS
-- ==========================================
local repo = 'https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/'
local Library = loadstring(game:HttpGet(repo .. 'Library.lua'))()
local ThemeManager = loadstring(game:HttpGet(repo .. 'addons/ThemeManager.lua'))()
SaveManager = loadstring(game:HttpGet(repo .. 'addons/SaveManager.lua'))()

-- Store global library reference for clean re-execution unloading
_G.UniversalHubLibrary = Library

pcall(function()
    if Library and Library.Gui then
        Library.Gui.Parent = SafeGuiContainer
    end
end)

Library.ToggleKeybind = Enum.KeyCode.RightControl

local Window = Library:CreateWindow({
    Title = 'LinoriaHeart Hub',
    Center = true,
    AutoShow = true,
    TabPadding = 8,
    MenuFadeTime = 0.2
})

pcall(function()
    if Library and Library.Gui then
        for _, desc in ipairs(Library.Gui:GetDescendants()) do
            if desc:IsA("TextLabel") then
                desc.TextWrapped = true
                desc.ClipsDescendants = true
            elseif desc:IsA("Frame") or desc:IsA("ScrollingFrame") then
                desc.ClipsDescendants = true
            end
        end

        local mainFrame = Library.Gui:FindFirstChildOfClass("Frame")
        if mainFrame then
            mainFrame.ClipsDescendants = true
            
            local resizeHandle = Instance.new("Frame")
            resizeHandle.Name = "ResizeGripHandle"
            resizeHandle.Size = UDim2.new(0, 16, 0, 16)
            resizeHandle.Position = UDim2.new(1, -16, 1, -16)
            resizeHandle.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
            resizeHandle.BorderSizePixel = 0
            resizeHandle.Active = true
            resizeHandle.ZIndex = 100
            resizeHandle.Parent = mainFrame

            local corner = Instance.new("UICorner")
            corner.CornerRadius = UDim.new(0, 4)
            corner.Parent = resizeHandle

            local isResizing = false
            local dragStart, startSize

            resizeHandle.InputBegan:Connect(function(input)
                if input.UserInputType == Enum.UserInputType.MouseButton1 then
                    isResizing = true
                    dragStart = input.Position
                    startSize = mainFrame.Size
                end
            end)

            UserInputService.InputChanged:Connect(function(input)
                if isResizing and input.UserInputType == Enum.UserInputType.MouseMovement then
                    local delta = input.Position - dragStart
                    local newX = math.clamp(startSize.X.Offset + delta.X, 450, 1000)
                    local newY = math.clamp(startSize.Y.Offset + delta.Y, 350, 800)
                    mainFrame.Size = UDim2.new(0, newX, 0, newY)
                end
            end)

            UserInputService.InputEnded:Connect(function(input)
                if input.UserInputType == Enum.UserInputType.MouseButton1 then
                    isResizing = false
                end
            end)
        end
    end
end)

local Tabs = {
    Player = Window:AddTab('Local'),
    Players = Window:AddTab('Players'),
    Visuals = Window:AddTab('Visuals'),
    Utilities = Window:AddTab('Utilities'),
    Config = Window:AddTab('Config'),
    Readme = Window:AddTab('README')
}

-- ==========================================
-- 6. LOCAL PLAYER TAB
-- ==========================================
local WaypointBox = Tabs.Player:AddLeftGroupbox('Teleport & Waypoints (50 Max)')

local newWaypointName = ""
WaypointBox:AddInput('WaypointNameInput', {
    Default = '',
    Numeric = false,
    Finished = false,
    Text = 'Waypoint Name',
    Placeholder = 'e.g. Base, Secret Room...',
    Callback = function(Value) newWaypointName = Value end
})

local waypointDropdown = WaypointBox:AddDropdown('SavedWaypointsDropdown', {
    Values = {'None'},
    Default = 1,
    Multi = false,
    Text = 'Saved Waypoints List',
    Callback = function(Value) selectedWaypointName = Value end
})

local function refreshWaypointDropdown()
    local names = {}
    for _, wp in ipairs(waypointsList) do table.insert(names, wp.Name) end
    waypointDropdown:SetValues(#names > 0 and names or {'None'})
end

WaypointBox:AddButton('Save Waypoint', function()
    trackFeature("Save_Waypoint")
    local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    if #waypointsList >= 50 then
        Library:Notify("Waypoint limit reached (Max 50)!", 3)
        return
    end

    local wpName = newWaypointName ~= "" and newWaypointName or ("Waypoint " .. (#waypointsList + 1))
    table.insert(waypointsList, { Name = wpName, CFrame = myHRP.CFrame })
    refreshWaypointDropdown()
    playCustomSound("General")
    Library:Notify("Saved Waypoint: " .. wpName, 3)
end)

WaypointBox:AddButton('Goto Selected Waypoint', function()
    trackFeature("Goto_Waypoint")
    local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    if not selectedWaypointName or selectedWaypointName == "None" then
        Library:Notify("No valid waypoint selected in list.", 3)
        return
    end

    for _, wp in ipairs(waypointsList) do
        if wp.Name == selectedWaypointName then
            myHRP.CFrame = wp.CFrame
            playCustomSound("General")
            Library:Notify("Teleported to waypoint: " .. wp.Name, 3)
            return
        end
    end
end)

WaypointBox:AddButton('Delete Selected Waypoint', function()
    if not selectedWaypointName or selectedWaypointName == "None" then
        Library:Notify("Select a waypoint to delete.", 3)
        return
    end

    for idx, wp in ipairs(waypointsList) do
        if wp.Name == selectedWaypointName then
            table.remove(waypointsList, idx)
            refreshWaypointDropdown()
            playCustomSound("General")
            Library:Notify("Deleted waypoint: " .. wp.Name, 3)
            break
        end
    end
end)

WaypointBox:AddButton('TP to SpawnLocation', function()
    trackFeature("TP_To_Spawn")
    local spawnCF = getGameSpawnLocation()
    local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    if spawnCF and myHRP then
        myHRP.CFrame = spawnCF
        playCustomSound("General")
        Library:Notify("Teleported to game SpawnLocation.", 3)
    else
        playCustomSound("General")
        Library:Notify("No valid SpawnLocation found in game.", 3)
    end
end)

local WaypointToolsBox = Tabs.Player:AddLeftGroupbox('Position & Axis Tools')

WaypointToolsBox:AddButton('Copy CFrame Coordinates', function()
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if hrp then
        local cfStr = tostring(hrp.CFrame)
        pcall(function()
            if setclipboard then setclipboard(cfStr) elseif toclipboard then toclipboard(cfStr) end
        end)
        playCustomSound("General")
        Library:Notify("CFrame Copied to Clipboard!", 3)
    end
end)

WaypointToolsBox:AddButton('Fix Character Axis (Face North)', function()
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if hrp then
        hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0, 0, 0)
        playCustomSound("General")
        Library:Notify("Character aligned to face North.", 3)
    end
end)

local MovementBox = Tabs.Player:AddRightGroupbox('Movement & Modifiers')

MovementBox:AddSlider('WalkSpeedSlider', {
    Text = 'WalkSpeed', Default = 16, Min = 16, Max = 250, Rounding = 0, Compact = false,
    Callback = function(Value)
        walkSpeedValue = Value
        local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
        if hum then hum.WalkSpeed = Value end
    end
})

MovementBox:AddToggle('DisableSlidingToggle', {
    Text = 'Disable Sliding (Instant Stop & Turn)', Default = false,
    Callback = function(Value)
        disableSlidingEnabled = Value
        trackFeature("Disable_Sliding")
    end
})

MovementBox:AddSlider('JumpPowerSlider', {
    Text = 'JumpPower', Default = 50, Min = 50, Max = 300, Rounding = 0, Compact = false,
    Callback = function(Value)
        jumpPowerValue = Value
        local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
        if hum then hum.UseJumpPower = true hum.JumpPower = Value end
    end
})

MovementBox:AddToggle('GravityToggle', {
    Text = 'Gravity', Default = false,
    Callback = function(Value)
        customGravityEnabled = Value
        workspace.Gravity = Value and customGravityValue or _G.OriginalGravity
    end
})

MovementBox:AddSlider('GravitySlider', {
    Text = 'Custom Gravity', Default = math.floor(_G.OriginalGravity), Min = -196, Max = math.floor(_G.OriginalGravity * 3), Rounding = 0, Compact = false,
    Callback = function(Value)
        customGravityValue = Value
        if customGravityEnabled then workspace.Gravity = Value end
    end
})

MovementBox:AddToggle('MaxSlopeToggle', {
    Text = 'MaxSlopeAngle', Default = false,
    Callback = function(Value)
        local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
        if hum then hum.MaxSlopeAngle = Value and 360 or 45 end
    end
})

MovementBox:AddToggle('NoVoidToggle', {
    Text = 'NoVoid', Default = true,
    Callback = function(Value)
        if Value then
            workspace.FallenPartsDestroyHeight = -900000000000000000000000
        else
            workspace.FallenPartsDestroyHeight = _G.OriginalFallenPartsDestroyHeight or -500
        end
    end
})
workspace.FallenPartsDestroyHeight = -900000000000000000000000

MovementBox:AddToggle('CameraZoomToggle', {
    Text = 'Max Camera Distance', Default = true,
    Callback = function(Value)
        customCameraZoomEnabled = Value
        LocalPlayer.CameraMaxZoomDistance = Value and customCameraZoomValue or _G.OriginalCameraMaxZoom
    end
})

MovementBox:AddSlider('CameraMaxZoomSlider', {
    Text = 'Camera Distance Max', Default = 1280, Min = 1280, Max = 12800, Rounding = 0, Compact = false,
    Callback = function(Value)
        customCameraZoomValue = Value
        if customCameraZoomEnabled then LocalPlayer.CameraMaxZoomDistance = Value end
    end
})
LocalPlayer.CameraMaxZoomDistance = 1280

MovementBox:AddSlider('FOVSlider', {
    Text = 'Field of View', Default = 70, Min = 60, Max = 120, Rounding = 0, Compact = false,
    Callback = function(Value)
        fovValue = Value
        Workspace.CurrentCamera.FieldOfView = Value
    end
})

MovementBox:AddToggle('FloatToggle', {
    Text = 'Float Platform', Default = false,
    Callback = function(Value)
        floatEnabled = Value
        floatBaseY = nil
        if not Value and floatPlatform then floatPlatform:Destroy() floatPlatform = nil end
    end
})

MovementBox:AddSlider('FloatOffsetSlider', {
    Text = 'Platform Y-Level', Default = 0, Min = -5, Max = 5, Rounding = 1, Compact = false,
    Callback = function(Value) floatYOffset = Value end
})

MovementBox:AddToggle('FloatQEToggle', { Text = 'Enable Holdable Q / E Controls', Default = true, Callback = function(Value) qeControlEnabled = Value end })
MovementBox:AddSlider('FloatSpeedSlider', { Text = 'Float Q/E Speed', Default = 42, Min = 10, Max = 200, Rounding = 0, Compact = false, Callback = function(Value) floatSpeedValue = Value end })

MovementBox:AddToggle('TPToolToggle', {
    Text = 'Give TP Tool', Default = false,
    Callback = function(Value)
        tpToolEnabled = Value
        if Value then giveTeleportTool() end
    end
})

-- ==========================================
-- 7. PLAYERS TAB
-- ==========================================
local PlrTpBox = Tabs.Players:AddLeftGroupbox('Player Teleport & Spectate')

local function tpToTargetPlayerOnce(targetName)
    if not targetName or targetName == "None" then return end
    local targetPlayer = Players:FindFirstChild(targetName)
    if targetPlayer and targetPlayer.Character then
        local targetHRP = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
        local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
        if targetHRP and myHRP then
            myHRP.CFrame = targetHRP.CFrame * CFrame.new(0, 0, 3)
            playCustomSound("General")
            Library:Notify("Teleported to " .. targetName, 3)
        end
    end
end

local playerTpDropdown = PlrTpBox:AddDropdown('PlayerTeleportDropdown', {
    Values = {'None'}, Default = 1, Multi = false, Text = 'Select Target Player',
    Callback = function(Value)
        selectedTpPlayer = Value
        if latchOntoEnabled and Value and Value ~= "None" and Value ~= lastLatchedTarget then
            lastLatchedTarget = Value
            tpToTargetPlayerOnce(Value)
        end
    end
})

PlrTpBox:AddButton('Teleport to Player', function()
    if selectedTpPlayer and selectedTpPlayer ~= "None" then
        tpToTargetPlayerOnce(selectedTpPlayer)
    else
        Library:Notify("Select a valid player first.", 3)
    end
end)

PlrTpBox:AddToggle('LatchOntoToggle', {
    Text = 'Boomerang to Player (TP & Return)',
    Default = false,
    Callback = function(Value)
        latchOntoEnabled = Value
        local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")

        if Value then
            if myHRP then
                ogLatchLocation = myHRP.CFrame
            end
            lastLatchedTarget = selectedTpPlayer
            if selectedTpPlayer and selectedTpPlayer ~= "None" then
                tpToTargetPlayerOnce(selectedTpPlayer)
            else
                Library:Notify("Latch Onto enabled. Select a player to latch!", 3)
            end
        else
            if myHRP and ogLatchLocation then
                myHRP.CFrame = ogLatchLocation
                playCustomSound("General")
                Library:Notify("Returned to original position.", 3)
            end
            ogLatchLocation = nil
            lastLatchedTarget = nil
        end
    end
})

local spectateDropdown = PlrTpBox:AddDropdown('SpectatePlayerDropdown', {
    Values = {LocalPlayer.Name}, Default = 1, Multi = false, Text = 'Select Player to Spectate',
    Callback = function(Value)
        removeSpectateTracer()
        if Value == "None" or not Value or Value == LocalPlayer.Name then
            if spectatingPlayer ~= nil then
                stopSpectating()
                playCustomSound("General")
                Library:Notify("Camera returned to your player.", 3)
            end
            return
        end

        local targetPlayer = Players:FindFirstChild(Value)
        if targetPlayer then
            spectatingPlayer = targetPlayer
            if targetPlayer.Character then
                local targetHum = targetPlayer.Character:FindFirstChildOfClass("Humanoid")
                local targetHRP = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
                if Workspace.CurrentCamera then
                    if targetHum then Workspace.CurrentCamera.CameraSubject = targetHum
                    elseif targetHRP then Workspace.CurrentCamera.CameraSubject = targetHRP end
                end
            end
            updateSpectateTracer()
            playCustomSound("General")
            Library:Notify("Spectating " .. targetPlayer.Name, 3)
        end
    end
})

local refreshScheduled = false
local function refreshPlayerLists()
    if refreshScheduled then return end
    refreshScheduled = true
    task.delay(0.2, function()
        refreshScheduled = false
        local tpNames, spectateNames = {}, {LocalPlayer.Name}
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer then
                table.insert(tpNames, p.Name)
                table.insert(spectateNames, p.Name)
            end
        end
        playerTpDropdown:SetValues(#tpNames > 0 and tpNames or {"None"})
        spectateDropdown:SetValues(spectateNames)
    end)
end

table.insert(connections, Players.PlayerAdded:Connect(refreshPlayerLists))
table.insert(connections, Players.PlayerRemoving:Connect(function(player)
    if spectatingPlayer == player then stopSpectating() end
    refreshPlayerLists()
end))
refreshPlayerLists()

local PlrTrackerBox = Tabs.Players:AddRightGroupbox('Player Trackers & Death Logs')
PlrTrackerBox:AddToggle('LowHPTrackerToggle', { Text = 'Track Low HP Players', Default = false, Callback = function(Value) lowHpTrackerEnabled = Value end })
PlrTrackerBox:AddToggle('DeathListenerToggle', { Text = 'Log Player Deaths Position', Default = false, Callback = function(Value) deathListenerEnabled = Value end })

local deathDropdown = PlrTrackerBox:AddDropdown('DeathLocationDropdown', { Values = {'None'}, Default = 1, Multi = false, Text = 'Select Logged Death Location' })

PlrTrackerBox:AddButton('Teleport to Death Location', function()
    local selectedLabel = deathDropdown.Value
    for _, entry in ipairs(deathLogs) do
        if entry.label == selectedLabel then
            local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
            if myHRP and entry.cframe then
                myHRP.CFrame = entry.cframe + Vector3.new(0, 3, 0)
                playCustomSound("General")
                Library:Notify("Teleported to death location of " .. entry.name, 3)
            end
            break
        end
    end
end)

local function bindCharacterTrackers(player)
    if player == LocalPlayer then return end
    local function onCharacter(char)
        local hum = char:WaitForChild("Humanoid", 5)
        local hrp = char:WaitForChild("HumanoidRootPart", 5)
        if not hum or not hrp then return end

        table.insert(connections, hum.HealthChanged:Connect(function(health)
            if lowHpTrackerEnabled and health <= 35 and health > 0 then
                if not lowHpDebounce[player] then
                    lowHpDebounce[player] = true
                    playCustomSound("LowHP")
                    Library:Notify(player.Name .. " is low! (" .. math.floor(health) .. " HP)", 4)
                end
            elseif health > 35 then
                lowHpDebounce[player] = nil
            end
        end))

        table.insert(connections, hum.Died:Connect(function()
            if deathListenerEnabled then
                local timeStr = os.date("%I:%M:%S %p")
                local voidThreshold = (_G.OriginalFallenPartsDestroyHeight or -500) + 50
                local isVoidDeath = hrp.Position.Y <= voidThreshold

                local label = isVoidDeath and string.format("%s VOID [%s]", player.Name, timeStr) or string.format("%s Died [%s]", player.Name, timeStr)

                playCustomSound("General")
                Library:Notify(label, 4)

                table.insert(deathLogs, 1, { name = player.Name, cframe = hrp.CFrame, label = label })
                local labels = {}
                for _, entry in ipairs(deathLogs) do table.insert(labels, entry.label) end
                deathDropdown:SetValues(labels)
            end
        end))
    end

    if player.Character then onCharacter(player.Character) end
    table.insert(connections, player.CharacterAdded:Connect(onCharacter))
end

for _, player in ipairs(Players:GetPlayers()) do bindCharacterTrackers(player) end
table.insert(connections, Players.PlayerAdded:Connect(bindCharacterTrackers))

-- ==========================================
-- 8. VISUALS TAB
-- ==========================================
local LightingBox = Tabs.Visuals:AddLeftGroupbox('Lighting & Graphics')

LightingBox:AddToggle('ShadowsToggle', { Text = 'Global Shadows', Default = true, Callback = function(Value) Lighting.GlobalShadows = Value end })
LightingBox:AddToggle('FullbrightToggle', {
    Text = 'Fullbright Mode', Default = false,
    Callback = function(Value)
        fullbrightEnabled = Value
        if not Value then Lighting.Ambient = _G.OriginalLighting.Ambient Lighting.Brightness = _G.OriginalLighting.Brightness end
    end
})

LightingBox:AddToggle('NoFogToggle', {
    Text = 'Disable Fog', Default = false,
    Callback = function(Value)
        noFogEnabled = Value
        if Value then Lighting.FogEnd = 1000000 else Lighting.FogEnd = _G.OriginalLighting.FogEnd Lighting.FogStart = _G.OriginalLighting.FogStart end
    end
})

LightingBox:AddToggle('PotatoToggle', {
    Text = 'Potato Graphics (Smooth Plastic)', Default = false,
    Callback = function(Value)
        potatoGraphicsEnabled = Value
        for part, originalMat in pairs(originalMaterials) do
            if part and part.Parent then part.Material = Value and Enum.Material.SmoothPlastic or originalMat end
        end
    end
})

local PathBox = Tabs.Visuals:AddLeftGroupbox('Instance Path Evaluator')

local pathInputExpr = "workspace.spawn:GetChildren()[1]"
local pathInputProp = "workspace.Spawn"
local activePathHighlights = {}
local pathHighlightTransparency = 0.5
local pathRangeLimit = 500

PathBox:AddInput('PathInputExpression', { Default = 'workspace.spawn:GetChildren()[1]', Text = 'Expression Path', Callback = function(Value) pathInputExpr = Value end })
PathBox:AddInput('PathInputProperty', { Default = 'workspace.Spawn', Text = 'Direct Property Path', Callback = function(Value) pathInputProp = Value end })

PathBox:AddSlider('PathHighlightTransparency', {
    Text = 'Path Highlight Transparency', Default = 0.5, Min = 0, Max = 1, Rounding = 2,
    Callback = function(Value)
        pathHighlightTransparency = Value
        for _, hl in ipairs(activePathHighlights) do if hl and hl.Parent then hl.FillTransparency = Value hl.OutlineTransparency = Value end end
    end
})

PathBox:AddSlider('PathRangeLimitSlider', { Text = 'Path Highlight Range (Studs)', Default = 500, Min = 50, Max = 10000, Rounding = 0, Callback = function(Value) pathRangeLimit = Value end })

PathBox:AddButton('Highlight Evaluated Paths', function()
    for _, hl in ipairs(activePathHighlights) do if hl then hl:Destroy() end end
    table.clear(activePathHighlights)

    local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
    local function evaluateAndHighlight(str)
        if not str or str == "" then return end
        pcall(function()
            local fn = loadstring("return " .. str)
            if fn then
                local res = fn()
                local targets = {}
                if typeof(res) == "Instance" then table.insert(targets, res)
                elseif type(res) == "table" then
                    for _, item in pairs(res) do if typeof(item) == "Instance" then table.insert(targets, item) end end
                end

                for _, target in ipairs(targets) do
                    if target:IsA("BasePart") or target:IsA("Model") then
                        local partToCheck = target:IsA("Model") and target.PrimaryPart or target
                        if partToCheck and myHRP and (partToCheck.Position - myHRP.Position).Magnitude <= pathRangeLimit then
                            local highlight = Instance.new("Highlight")
                            highlight.Adornee = target
                            highlight.FillColor = Color3.fromRGB(255, 170, 0)
                            highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
                            highlight.FillTransparency = pathHighlightTransparency
                            highlight.OutlineTransparency = pathHighlightTransparency
                            highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
                            highlight.Parent = customHighlightFolder
                            table.insert(activePathHighlights, highlight)
                        end
                    end
                end
            end
        end)
    end
    evaluateAndHighlight(pathInputExpr)
    evaluateAndHighlight(pathInputProp)
    playCustomSound("General")
    Library:Notify("Wall-penetrating highlights applied.", 3)
end)

PathBox:AddButton('Clear Path Highlights', function()
    for _, hl in ipairs(activePathHighlights) do if hl then hl:Destroy() end end
    table.clear(activePathHighlights)
    playCustomSound("General")
    Library:Notify("Cleared path highlights.", 2)
end)

local EspBox = Tabs.Visuals:AddRightGroupbox('Player & NPC ESP')

local allPlayersHighlightEnabled, allPlayersHighlightTransparency = false, 0.5
local playerHealthNameEnabled, playerTextSize, playerTextTransparency, playerRangeLimit = false, 14, 0, 500
local allNpcsHighlightEnabled, allNpcsHighlightTransparency = false, 0.5
local npcHealthNameEnabled, npcTextSize, npcTextTransparency, npcRangeLimit = false, 14, 0, 500

EspBox:AddToggle('HighlightAllPlayersToggle', {
    Text = 'Highlight All Players', Default = false,
    Callback = function(Value)
        allPlayersHighlightEnabled = Value
        if not Value then for _, data in pairs(playerHighlights) do if data.highlight then data.highlight:Destroy() data.highlight = nil end end end
    end
})

EspBox:AddToggle('PlayerHealthNameToggle', {
    Text = 'Player Health & Name Text', Default = false,
    Callback = function(Value)
        playerHealthNameEnabled = Value
        if not Value then for _, data in pairs(playerHighlights) do if data.billboard then data.billboard:Destroy() data.billboard = nil end data.textLabel = nil end end
    end
})

EspBox:AddSlider('PlayerHighlightTransparencySlider', {
    Text = 'Player Highlight Transparency', Default = 0.5, Min = 0, Max = 1, Rounding = 2,
    Callback = function(Value)
        allPlayersHighlightTransparency = Value
        for _, data in pairs(playerHighlights) do if data.highlight then data.highlight.FillTransparency = Value data.highlight.OutlineTransparency = Value end end
    end
})

EspBox:AddSlider('PlayerRangeLimitSlider', { Text = 'Player ESP Range Limit (Studs)', Default = 500, Min = 50, Max = 10000, Rounding = 0, Callback = function(Value) playerRangeLimit = Value end })

EspBox:AddSlider('PlayerTextOffsetYSlider', {
    Text = 'Player Text Y-Offset (Studs)', Default = 2.5, Min = -10, Max = 10, Rounding = 1, Compact = false,
    Callback = function(Value)
        playerTextOffsetY = Value
        for _, data in pairs(playerHighlights) do if data.billboard then data.billboard.StudsOffset = Vector3.new(0, Value, 0) end end
    end
})

EspBox:AddSlider('PlayerTextSizeSlider', {
    Text = 'Player Text Size', Default = 14, Min = 8, Max = 32, Rounding = 0,
    Callback = function(Value)
        playerTextSize = Value
        for _, data in pairs(playerHighlights) do if data.textLabel then data.textLabel.TextSize = Value end end
    end
})

EspBox:AddSlider('PlayerTextTransparencySlider', {
    Text = 'Player Text Transparency', Default = 0, Min = 0, Max = 1, Rounding = 2,
    Callback = function(Value)
        playerTextTransparency = Value
        for _, data in pairs(playerHighlights) do if data.textLabel then data.textLabel.TextTransparency = Value data.textLabel.TextStrokeTransparency = Value end end
    end
})

EspBox:AddToggle('HighlightAllNpcsToggle', {
    Text = 'Highlight All NPCs', Default = false,
    Callback = function(Value)
        allNpcsHighlightEnabled = Value
        if not Value then for _, data in pairs(npcHighlights) do if data.highlight then data.highlight:Destroy() data.highlight = nil end end end
    end
})

EspBox:AddToggle('NpcHealthNameToggle', {
    Text = 'NPC Health & Name Display', Default = false,
    Callback = function(Value)
        npcHealthNameEnabled = Value
        if not Value then for _, data in pairs(npcHighlights) do if data.billboard then data.billboard:Destroy() data.billboard = nil end data.textLabel = nil end end
    end
})

EspBox:AddSlider('NpcHighlightTransparencySlider', {
    Text = 'NPC Highlight Transparency', Default = 0.5, Min = 0, Max = 1, Rounding = 2,
    Callback = function(Value)
        allNpcsHighlightTransparency = Value
        for _, data in pairs(npcHighlights) do if data.highlight then data.highlight.FillTransparency = Value data.highlight.OutlineTransparency = Value end end
    end
})

EspBox:AddSlider('NpcRangeLimitSlider', { Text = 'NPC ESP Range Limit (Studs)', Default = 500, Min = 50, Max = 10000, Rounding = 0, Callback = function(Value) npcRangeLimit = Value end })

EspBox:AddSlider('NpcTextSizeSlider', {
    Text = 'NPC Text Size', Default = 14, Min = 8, Max = 32, Rounding = 0,
    Callback = function(Value)
        npcTextSize = Value
        for _, data in pairs(npcHighlights) do if data.textLabel then data.textLabel.TextSize = Value end end
    end
})

EspBox:AddSlider('NpcTextTransparencySlider', {
    Text = 'NPC Text Transparency', Default = 0, Min = 0, Max = 1, Rounding = 2,
    Callback = function(Value)
        npcTextTransparency = Value
        for _, data in pairs(npcHighlights) do if data.textLabel then data.textLabel.TextTransparency = Value data.textLabel.TextStrokeTransparency = Value end end
    end
})

local cachedNpcs = {}
task.spawn(function()
    while activeLoops[1] do
        pcall(function()
            loopHeartbeats.npcScan = tick()
            if allNpcsHighlightEnabled or npcHealthNameEnabled then
                local found = {}
                for _, obj in ipairs(Workspace:GetDescendants()) do
                    if obj:IsA("Model") and obj:FindFirstChildOfClass("Humanoid") and Players:GetPlayerFromCharacter(obj) == nil and obj ~= LocalPlayer.Character then
                        table.insert(found, obj)
                    end
                end
                cachedNpcs = found
            else
                table.clear(cachedNpcs)
            end
        end)
        task.wait(1.0)
    end
end)

table.insert(connections, RunService.Heartbeat:Connect(function()
    pcall(function()
        local myHRP = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")

        -- Players Loop
        for _, plr in ipairs(Players:GetPlayers()) do
            if plr ~= LocalPlayer and plr.Character then
                local char = plr.Character
                local head = char:FindFirstChild("Head") or char:FindFirstChild("HumanoidRootPart")
                local hrp = char:FindFirstChild("HumanoidRootPart")
                local hum = char:FindFirstChildOfClass("Humanoid")

                if not playerHighlights[plr] then playerHighlights[plr] = {} end
                local data = playerHighlights[plr]

                local inRange = not (myHRP and hrp and (hrp.Position - myHRP.Position).Magnitude > playerRangeLimit)

                if allPlayersHighlightEnabled and inRange then
                    if not data.highlight or not data.highlight.Parent then
                        local hl = Instance.new("Highlight")
                        hl.Adornee = char
                        hl.FillColor = Color3.fromRGB(255, 255, 255)
                        hl.OutlineColor = Color3.fromRGB(0, 0, 0)
                        hl.FillTransparency = allPlayersHighlightTransparency
                        hl.OutlineTransparency = allPlayersHighlightTransparency
                        hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
                        hl.Parent = customHighlightFolder
                        data.highlight = hl
                    end
                else
                    if data.highlight then data.highlight:Destroy() data.highlight = nil end
                end

                if playerHealthNameEnabled and inRange then
                    if not data.billboard or not data.billboard.Parent then
                        local bb = Instance.new("BillboardGui")
                        bb.Size = UDim2.new(0, 200, 0, 50)
                        bb.StudsOffset = Vector3.new(0, playerTextOffsetY, 0)
                        bb.AlwaysOnTop = true
                        bb.Adornee = head or char

                        local tl = Instance.new("TextLabel")
                        tl.Size = UDim2.new(1, 0, 1, 0)
                        tl.BackgroundTransparency = 1
                        tl.TextColor3 = Color3.fromRGB(255, 255, 255)
                        tl.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
                        tl.TextStrokeTransparency = playerTextTransparency
                        tl.TextTransparency = playerTextTransparency
                        tl.TextSize = playerTextSize
                        tl.Font = Enum.Font.SourceSansBold
                        tl.Parent = bb
                        bb.Parent = customHighlightFolder

                        data.billboard = bb
                        data.textLabel = tl
                    else
                        if head then data.billboard.Adornee = head end
                        data.billboard.StudsOffset = Vector3.new(0, playerTextOffsetY, 0)
                        if data.textLabel and hum then
                            data.textLabel.Text = string.format("%s\n[%d / %d HP]", plr.Name, math.floor(hum.Health), math.floor(hum.MaxHealth))
                        end
                    end
                else
                    if data.billboard then data.billboard:Destroy() data.billboard = nil data.textLabel = nil end
                end
            end
        end

        -- NPCs Loop
        for _, obj in ipairs(cachedNpcs) do
            if obj and obj.Parent then
                local head = obj:FindFirstChild("Head") or obj:FindFirstChild("HumanoidRootPart")
                local hrp = obj:FindFirstChild("HumanoidRootPart")
                local hum = obj:FindFirstChildOfClass("Humanoid")

                if not npcHighlights[obj] then npcHighlights[obj] = {} end
                local data = npcHighlights[obj]

                local inRange = not (myHRP and hrp and (hrp.Position - myHRP.Position).Magnitude > npcRangeLimit)

                if allNpcsHighlightEnabled and inRange then
                    if not data.highlight or not data.highlight.Parent then
                        local hl = Instance.new("Highlight")
                        hl.Adornee = obj
                        hl.FillColor = Color3.fromRGB(255, 255, 255)
                        hl.OutlineColor = Color3.fromRGB(0, 0, 0)
                        hl.FillTransparency = allNpcsHighlightTransparency
                        hl.OutlineTransparency = allNpcsHighlightTransparency
                        hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
                        hl.Parent = customHighlightFolder
                        data.highlight = hl
                    end
                else
                    if data.highlight then data.highlight:Destroy() data.highlight = nil end
                end

                if npcHealthNameEnabled and inRange then
                    if not data.billboard or not data.billboard.Parent then
                        local bb = Instance.new("BillboardGui")
                        bb.Size = UDim2.new(0, 200, 0, 50)
                        bb.StudsOffset = Vector3.new(0, 2.5, 0)
                        bb.AlwaysOnTop = true
                        bb.Adornee = head or obj

                        local tl = Instance.new("TextLabel")
                        tl.Size = UDim2.new(1, 0, 1, 0)
                        tl.BackgroundTransparency = 1
                        tl.TextColor3 = Color3.fromRGB(255, 255, 255)
                        tl.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
                        tl.TextStrokeTransparency = npcTextTransparency
                        tl.TextTransparency = npcTextTransparency
                        tl.TextSize = npcTextSize
                        tl.Font = Enum.Font.SourceSansBold
                        tl.Parent = bb
                        bb.Parent = customHighlightFolder

                        data.billboard = bb
                        data.textLabel = tl
                    else
                        if head then data.billboard.Adornee = head end
                        if data.textLabel and hum then
                            data.textLabel.Text = string.format("%s\n[%d / %d HP]", obj.Name, math.floor(hum.Health), math.floor(hum.MaxHealth))
                        end
                    end
                else
                    if data.billboard then data.billboard:Destroy() data.billboard = nil data.textLabel = nil end
                end
            end
        end
    end)
end))

-- ==========================================
-- 9. UTILITIES & TOOLS TAB
-- ==========================================
local ActivityBox = Tabs.Utilities:AddLeftGroupbox('Activity & Tools')

ActivityBox:AddToggle('JoinLogToggle', { Text = 'Log Player Activity', Default = false, Callback = function(Value) joinLogEnabled = Value end })

table.insert(connections, Players.PlayerRemoving:Connect(function(player)
    if playerJoinTimes[player] then
        if joinLogEnabled then
            local sessionDuration = math.floor(tick() - playerJoinTimes[player])
            local hours = math.floor(sessionDuration / 3600)
            local mins = math.floor((sessionDuration % 3600) / 60)
            local secs = sessionDuration % 60
            local notifMsg = string.format("%s Left [%d:%02d:%02d]", player.Name, hours, mins, secs)
            table.insert(leaveNotifQueue, notifMsg)
            processLeaveNotificationQueue(Library)
        end
        playerJoinTimes[player] = nil
    end
end))

ActivityBox:AddButton('Execute SaveInstance', function()
    pcall(function()
        local Params = { RepoURL = "https://raw.githubusercontent.com/luau/UniversalSynSaveInstance/main/", SSI = "saveinstance" }
        local synsaveinstance = loadstring(game:HttpGet(Params.RepoURL .. Params.SSI .. ".luau", true), Params.SSI)()
        synsaveinstance({ SafeMode = true, DecompileTimeout = 15, SaveBytecode = true })
    end)
end)

ActivityBox:AddButton('Load Infinite Yield', function()
    pcall(function() loadstring(game:HttpGet("https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source"))() end)
end)

local DiagBox = Tabs.Utilities:AddRightGroupbox('Diagnostics & Workspace Stats')
local instanceCountLabel = DiagBox:AddLabel('Workspace Instances: Not Scanned')

DiagBox:AddButton('Scan Workspace Objects', function()
    local anchoredCount, unanchoredCount, npcCount, playerCount, toolCount = 0, 0, 0, 0, 0
    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("BasePart") then
            if obj.Anchored then anchoredCount = anchoredCount + 1 else unanchoredCount = unanchoredCount + 1 end
        elseif obj:IsA("Tool") then
            toolCount = toolCount + 1
        elseif obj:IsA("Model") and obj:FindFirstChildOfClass("Humanoid") then
            if Players:GetPlayerFromCharacter(obj) then playerCount = playerCount + 1 else npcCount = npcCount + 1 end
        end
    end
    instanceCountLabel:SetText(string.format("Anchored: %d | Unanchored: %d\nNPCs: %d | Players: %d | Tools: %d", anchoredCount, unanchoredCount, npcCount, playerCount, toolCount))
end)

local statsLabel = DiagBox:AddLabel('Performance Tracker: Disabled')
local statsTrackerEnabled = false

DiagBox:AddToggle('StatsTrackerToggle', {
    Text = 'Enable Live Performance Tracker', Default = false,
    Callback = function(Value)
        statsTrackerEnabled = Value
        if not Value then statsLabel:SetText("Performance Tracker: Disabled") end
    end
})

task.spawn(function()
    while activeLoops[1] do
        if statsTrackerEnabled then
            pcall(function()
                local fps = math.floor(1 / math.max(RunService.RenderStepped:Wait(), 0.001))
                local ping = math.floor(LocalPlayer:GetNetworkPing() * 1000)
                local memMb = math.floor(StatsService:GetTotalMemoryUsageMb())
                statsLabel:SetText(string.format("FPS: %d | Ping: %d ms | Memory: %d MB", fps, ping, memMb))
            end)
            task.wait(0.5)
        else
            task.wait(1)
        end
    end
end)

-- ==========================================
-- 10. CONFIG, SOUND & TELEMETRY TAB
-- ==========================================
local SettingsBox = Tabs.Config:AddLeftGroupbox('Menu Keybinds & Telemetry')
SettingsBox:AddLabel('Menu Keybind'):AddKeyPicker('MenuKeybind', { Default = 'RightControl', NoUI = true, Text = 'Menu keybind' })

SettingsBox:AddToggle('TelemetryToggle', { Text = 'Telemetry & Analytics Tracker', Default = true, Callback = function(Value) telemetryData.Enabled = Value end })

SettingsBox:AddButton('Print Telemetry Data to Console', function()
    print("---------------- TELEMETRY SUMMARY ----------------")
    print("Game Name: " .. tostring(telemetryData.GameName))
    print("Place ID: " .. tostring(telemetryData.PlaceId))
    print("Game ID: " .. tostring(telemetryData.GameId))
    print("Executor: " .. tostring(telemetryData.Executor))
    print("Active Duration: " .. tostring(os.time() - telemetryData.SessionStart) .. "s")
    print("Feature Usage Counters:")
    for feat, count in pairs(telemetryData.FeatureUsage) do print(" - " .. feat .. ": " .. tostring(count)) end
    print("---------------------------------------------------")
    Library:Notify("Telemetry dumped to F12 Developer Console.", 3)
end)

local SoundBox = Tabs.Config:AddRightGroupbox('Sound Customization')

SoundBox:AddSlider('LowHPSoundVolume', { Text = 'Low HP Volume', Default = 0.5, Min = 0, Max = 1, Rounding = 2, Callback = function(Value) soundSettings.LowHP.Volume = Value end })
SoundBox:AddDropdown('LowHPSoundID', {
    Values = {'Default (Bell)', 'Chime', 'Pop'}, Default = 1, Multi = false, Text = 'Low HP Sound Effect',
    Callback = function(Value)
        if Value == "Default (Bell)" then soundSettings.LowHP.SoundId = "rbxassetid://4590657391"
        elseif Value == "Chime" then soundSettings.LowHP.SoundId = "rbxassetid://9060817403"
        elseif Value == "Pop" then soundSettings.LowHP.SoundId = "rbxassetid://9114220737" end
    end
})

SoundBox:AddSlider('PlayerLeftSoundVolume', { Text = 'Player Left Volume', Default = 0.5, Min = 0, Max = 1, Rounding = 2, Callback = function(Value) soundSettings.PlayerLeft.Volume = Value end })
SoundBox:AddDropdown('PlayerLeftSoundID', {
    Values = {'Default (Pop)', 'Chime', 'Bell'}, Default = 1, Multi = false, Text = 'Player Left Sound Effect',
    Callback = function(Value)
        if Value == "Default (Pop)" then soundSettings.PlayerLeft.SoundId = "rbxassetid://9114220737"
        elseif Value == "Chime" then soundSettings.PlayerLeft.SoundId = "rbxassetid://9060817403"
        elseif Value == "Bell" then soundSettings.PlayerLeft.SoundId = "rbxassetid://4590657391" end
    end
})

SoundBox:AddSlider('GeneralSoundVolume', { Text = 'General Sound Volume', Default = 0.5, Min = 0, Max = 1, Rounding = 2, Callback = function(Value) soundSettings.General.Volume = Value end })
SoundBox:AddDropdown('GeneralSoundID', {
    Values = {'Default (Chime)', 'Bell', 'Pop'}, Default = 1, Multi = false, Text = 'General Sound Effect',
    Callback = function(Value)
        if Value == "Default (Chime)" then soundSettings.General.SoundId = "rbxassetid://9060817403"
        elseif Value == "Bell" then soundSettings.General.SoundId = "rbxassetid://4590657391"
        elseif Value == "Pop" then soundSettings.General.SoundId = "rbxassetid://9114220737" end
    end
})

ThemeManager:SetLibrary(Library)
SaveManager:SetLibrary(Library)
SaveManager:IgnoreThemeSettings()
SaveManager:SetFolder('LinoriaClientHub/configs')

ThemeManager:ApplyToTab(Tabs.Config)
SaveManager:BuildConfigSection(Tabs.Config)

-- ==========================================
-- 11. README TAB
-- ==========================================
local InfoBox = Tabs.Readme:AddLeftGroupbox('Information & Features')
InfoBox:AddLabel('Universal Linoria Client Hub')
InfoBox:AddLabel('• Toggle UI: Right Control (Default)')
InfoBox:AddLabel('• Resizable UI: Drag bottom-right corner grip')
InfoBox:AddLabel('• Garbage Cleaning: Auto GC runs every 60s')
InfoBox:AddLabel('• Auto Error Fixer: Watchdog monitors & heals errors')
InfoBox:AddLabel('• Latch Onto: TPs to player ONCE, returns to OG spot when OFF')

local UserNotesBox = Tabs.Readme:AddRightGroupbox('Credits')
UserNotesBox:AddLabel('Tennisballs9000 on discord')
UserNotesBox:AddLabel('Linorias Library')
UserNotesBox:AddLabel('You, for using this script ❤️')

-- ==========================================
-- 12. RUNTIME HANDLERS & PHYSICS FIXES
-- ==========================================
table.insert(connections, LocalPlayer.CharacterAdded:Connect(function(char)
    char:WaitForChild("Humanoid")
    task.wait(0.5)
    local hum = char:FindFirstChildOfClass("Humanoid")
    if hum then
        hum.WalkSpeed = walkSpeedValue
        hum.UseJumpPower = true
        hum.JumpPower = jumpPowerValue
    end
    if tpToolEnabled then giveTeleportTool() end
end))

table.insert(connections, RunService.RenderStepped:Connect(function()
    pcall(function()
        loopHeartbeats.render = tick()
        if Workspace.CurrentCamera.FieldOfView ~= fovValue then
            Workspace.CurrentCamera.FieldOfView = fovValue
        end

        if fullbrightEnabled then
            Lighting.Ambient = Color3.new(1, 1, 1)
            Lighting.Brightness = 2
        end

        if spectatingPlayer then
            if spectatingPlayer.Character then
                local targetHum = spectatingPlayer.Character:FindFirstChildOfClass("Humanoid")
                local targetHRP = spectatingPlayer.Character:FindFirstChild("HumanoidRootPart")
                local targetSub = targetHum or targetHRP
                if targetSub and Workspace.CurrentCamera and Workspace.CurrentCamera.CameraSubject ~= targetSub then
                    Workspace.CurrentCamera.CameraSubject = targetSub
                end
                updateSpectateTracer()
            else
                removeSpectateTracer()
            end
        else
            removeSpectateTracer()
        end
    end)
end))

table.insert(connections, RunService.Heartbeat:Connect(function(dt)
    pcall(function()
        loopHeartbeats.heartbeat = tick()
        if floatEnabled then updateFloatPlatform(dt) end

        local char = LocalPlayer.Character
        local hrp = char and char:FindFirstChild("HumanoidRootPart")
        local hum = char and char:FindFirstChildOfClass("Humanoid")

        if disableSlidingEnabled and hrp and hum then
            if hum.FloorMaterial ~= Enum.Material.Air then
                if hum.MoveDirection.Magnitude > 0 then
                    local targetSpeed = hum.WalkSpeed
                    local dir = hum.MoveDirection
                    hrp.AssemblyLinearVelocity = Vector3.new(dir.X * targetSpeed, hrp.AssemblyLinearVelocity.Y, dir.Z * targetSpeed)
                else
                    hrp.AssemblyLinearVelocity = Vector3.new(0, hrp.AssemblyLinearVelocity.Y, 0)
                end
            end
        end
    end)
end))

SaveManager:LoadAutoloadConfig()

playCustomSound("General")
Library:Notify("LinoriaHeart Loaded! | Right Ctrl to minimize", 5)

Features & Information

FluentHeart's older brother. [OPEN SOURCE] Movement WalkSpeed & JumpPower Sliders: Adjust character movement speed (16–250) and jump height (50–300). Instant Stop (Disable Sliding): Removes character deceleration so you stop moving immediately when keys are released. Custom Gravity & Slope Angle: Adjustable gravity control and 360° MaxSlopeAngle toggle to walk up vertical surfaces. No Void Protection: Lowers the void kill-boundary height so you don't die or get destroyed when falling off the map. Camera & FOV Controls: Field of view slider (60–120) and extended camera zoom distance slider (up to 12,800 studs). Float Platform: Spawns an anchored platform beneath your feet with customizable vertical offset and Q/E key controls for moving up and down. Waypoint System: Save up to 50 custom position waypoints, teleport to saved points, delete waypoints, or TP directly to any active game SpawnLocation. Position & Axis Tools: One-click copy for current CFrame coordinates to clipboard and snap character facing direction directly North. Teleport Tool: Equips a click-to-teleport tool in your inventory. Players & Tracking Player Teleport: Select any player from a dropdown list to instantly teleport to their location. Latch Onto Player: Teleports to a chosen player and automatically teleports you back to your starting position once turned off. Spectate Camera & Beam Tracer: Spectate target player viewports with a visual beam tracer drawing a line between your character and theirs. Low HP Tracker: Audio alerts and notifications when surrounding players drop below 35 HP. Death Logger & Teleport: Automatically logs player death coordinates (including void deaths) with timestamps and allows you to teleport to where they died. Visuals & Rendering Lighting Adjustments: Fullbright toggle, disable fog, and global shadow toggle. Potato Graphics: Converts world materials to Smooth Plastic for more FPS on lower-end devices. Player ESP: Wall-penetrating highlights and Billboard text displaying player names and real-time health (with range, font size, Y-offset, and transparency sliders). NPC ESP: Separate highlight and text display for non-player humanoids in workspace. Instance Path Evaluator: Evaluates string expressions or property paths (e.g., workspace.spawn:GetChildren()[1]) and highlights matched parts through walls. Utilities & Diagnostics Player Activity Logger: Tracks player leave events and session durations with queued notification popups. Integrated Script Launchers: One-click execution for UniversalSynSaveInstance and Infinite Yield. Workspace Scanner: Scans workspace to count anchored parts, unanchored parts, tools, players, and NPCs. Live Performance Tracker: Monitors real-time FPS, network latency (Ping in ms), and total Memory usage (MB). Customization & Configurations Custom UI Keybind: Remap the UI toggle key (default is Right Control). Sound Customization: Select sound IDs and adjust volumes for Low HP, Player Left, and General UI notifications. Linoria Config & Theme Manager: Save, load, and auto-load script profiles or customize UI theme colors. Telemetry & Usage Stats: Optional feature counter that logs script session metrics to the developer console (F9).
#open source#universal#saveinstance#linorialib#debugging

Community Comments (1)

benzobenzoOct 6, 2026

credits to chatgpt

More Scripts for Universal Scripts