hat orbit script
Key Required

hat orbit script

Free Client Script Executor *BACK*Dastyr268Dastyr268 1.4K views 356 executesUpdated Dec 11, 2025
Unrated
00
Lua Script•528 lines (19176 chars)
--// CONFIG \\--
local Config = {
    MaxHats = 10,
    Height = 10,
    Scale = 0.6,
    Speed = 0.7,
    Radius = 6,
    Clockwise = true,
    NetlessVel = Vector3.new(30, 0, 0),
    
    Mode = "Heart",
    RGBMode = false,
    ShowTrails = false,
    RotateHats = false,
    MultiLayer = false,
    
    HeightStep = 1,
    ScaleStep = 0.05,
    SpeedStep = 0.1,
    RadiusStep = 0.5
}

--// SERVICES \\--
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local lp = Players.LocalPlayer
local char = lp.Character or lp.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")

--// ═══════════════════════════════════════════════════════════════
--//   PRESETS
--// ═══════════════════════════════════════════════════════════════

local Presets = {
    giant = {Mode = "Heart", Height = 15, Scale = 1.2, Speed = 0.5, Radius = 10},
    fast = {Mode = "Orbit", Height = 8, Scale = 0.6, Speed = 2, Radius = 8},
    slow = {Mode = "Spiral", Height = 12, Scale = 0.5, Speed = 0.3, Radius = 6},
    crazy = {Mode = "Wave", Height = 10, Scale = 0.7, Speed = 1.5, Radius = 10},
    mini = {Mode = "Heart", Height = 5, Scale = 0.3, Speed = 1, Radius = 4},
    double = {Mode = "Orbit", Height = 8, Scale = 0.6, Speed = 0.8, Radius = 7, MultiLayer = true}
}

--// ═══════════════════════════════════════════════════════════════
--//   HAT COLLECTION & DETACHMENT
--// ═══════════════════════════════════════════════════════════════

local hats = {}
local hatTrails = {}
local showEffect = true

-- Detach handle from character (remove all welds/motors)
local function detachHandle(handle)
    for _, obj in ipairs(handle:GetDescendants()) do
        if obj:IsA("Weld") or obj:IsA("Motor6D") or obj:IsA("WeldConstraint") or obj:IsA("Attachment") then
            pcall(function() obj:Destroy() end)
        end
    end
end

-- Get RGB color based on time
local function getRGBColor(t)
    return Color3.fromHSV((t / 3) % 1, 1, 1)
end

-- Create trail effect for hat
local function createTrail(handle)
    local attach0 = Instance.new("Attachment")
    attach0.Parent = handle
    
    local trail = Instance.new("Trail")
    trail.Parent = handle
    trail.Attachment0 = attach0
    trail.Attachment1 = attach0
    trail.Lifetime = 0.5
    trail.MinLength = 0
    trail.FaceCamera = true
    trail.Color = ColorSequence.new(Color3.fromRGB(255, 100, 150))
    trail.Transparency = NumberSequence.new{
        NumberSequenceKeypoint.new(0, 0.5),
        NumberSequenceKeypoint.new(1, 1)
    }
    trail.WidthScale = NumberSequence.new(0.5)
    
    return trail
end

-- Collect all accessories from character
local function collectHats()
    table.clear(hats)
    
    -- Remove old trails
    for _, trail in pairs(hatTrails) do
        if trail then pcall(function() trail:Destroy() end) end
    end
    table.clear(hatTrails)
    
    for _, inst in ipairs(char:GetChildren()) do
        if inst:IsA("Accessory") then
            local handle = inst:FindFirstChild("Handle")
            if handle and handle:IsA("BasePart") then
                detachHandle(handle)
                
                -- Move accessory to workspace
                inst.Parent = workspace
                
                -- Setup physics
                handle.Massless = true
                handle.CanCollide = false
                handle.Anchored = false
                handle.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
                
                -- Set network owner to client for netless
                pcall(function()
                    handle:SetNetworkOwner(lp)
                end)
                
                table.insert(hats, handle)
                
                -- Create trail if enabled
                if Config.ShowTrails then
                    hatTrails[handle] = createTrail(handle)
                end
                
                if #hats >= Config.MaxHats then break end
            end
        end
    end
    
    print("[Heart Orbit] Collected " .. #hats .. " accessories")
    return #hats
end

collectHats()

-- Auto-refresh when new accessory added
char.ChildAdded:Connect(function(c)
    if c:IsA("Accessory") then
        task.wait(0.15)
        collectHats()
    end
end)

--// ═══════════════════════════════════════════════════════════════
--//   NETLESS LOOP (keeps hats from falling)
--// ═══════════════════════════════════════════════════════════════

RunService.Heartbeat:Connect(function()
    for _, handle in ipairs(hats) do
        if handle and handle.Parent then
            handle.AssemblyLinearVelocity = Config.NetlessVel
            handle.AssemblyAngularVelocity = Vector3.zero
        end
    end
end)

--// ═══════════════════════════════════════════════════════════════
--//   SHAPE FUNCTIONS (parametric curves for different modes)
--// ═══════════════════════════════════════════════════════════════

-- Heart shape using parametric equation
local function heart2D(t)
    local s = math.sin(t)
    local c = math.cos(t)
    local x = 16 * (s^3)
    local y = 13*c - 5*math.cos(2*t) - 2*math.cos(3*t) - math.cos(4*t)
    return Vector3.new(x * Config.Scale, y * Config.Scale, 0)
end

-- Circle orbit around player
local function orbit(t, layer)
    layer = layer or 0
    local rad = Config.Radius + (layer * 2)
    return Vector3.new(
        math.cos(t) * rad,
        layer * 2,
        math.sin(t) * rad
    )
end

-- Spiral going upward
local function spiral(t, heightOffset)
    return Vector3.new(
        math.cos(t) * Config.Radius,
        heightOffset * 2,
        math.sin(t) * Config.Radius
    )
end

-- Wave pattern
local function wave(t, heightOffset)
    return Vector3.new(
        math.cos(t) * Config.Radius,
        math.sin(t * 3) * 2,
        math.sin(t) * Config.Radius
    )
end

-- Infinity symbol (lemniscate)
local function infinity(t)
    local scale = Config.Scale * 10
    return Vector3.new(
        scale * math.sin(t),
        0,
        scale * math.sin(t) * math.cos(t)
    )
end

-- Star pattern
local function star(t)
    local points = 5
    local inner = Config.Radius * 0.5
    local outer = Config.Radius
    local angle = (t % (math.pi * 2 / points)) * points
    local radius = (math.floor(t / (math.pi * 2 / points)) % 2 == 0) and outer or inner
    return Vector3.new(
        math.cos(angle) * radius,
        0,
        math.sin(angle) * radius
    )
end

-- DNA helix pattern
local function helix(t, heightOffset)
    return Vector3.new(
        math.cos(t) * Config.Radius,
        t * 0.5 + heightOffset,
        math.sin(t) * Config.Radius
    )
end

--// ═══════════════════════════════════════════════════════════════
--//   MAIN RENDER LOOP (updates hat positions every frame)
--// ═══════════════════════════════════════════════════════════════

local t0 = tick()

RunService.RenderStepped:Connect(function()
    if not showEffect or not hrp or not hrp.Parent or #hats == 0 then return end
    
    local now = tick() - t0
    local dir = Config.Clockwise and 1 or -1
    local tBase = now * Config.Speed * dir
    
    for i, handle in ipairs(hats) do
        if handle and handle.Parent then
            local offset = (i-1) / #hats * math.pi * 2
            local tParam = tBase + offset
            local pos
            local layer = Config.MultiLayer and (i % 2) or 0
            
            -- Calculate position based on current mode
            if Config.Mode == "Heart" then
                local p2d = heart2D(tParam)
                pos = Vector3.new(p2d.X, Config.Height + p2d.Y, p2d.Z)
                
            elseif Config.Mode == "Orbit" then
                local orb = orbit(tParam, layer)
                pos = Vector3.new(orb.X, Config.Height + orb.Y, orb.Z)
                
            elseif Config.Mode == "Spiral" then
                local heightOff = (i-1) / #hats * Config.Height
                local spr = spiral(tParam, heightOff)
                pos = Vector3.new(spr.X, Config.Height + spr.Y, spr.Z)
                
            elseif Config.Mode == "Wave" then
                local wv = wave(tParam, (i-1) / #hats)
                pos = Vector3.new(wv.X, Config.Height + wv.Y, wv.Z)
                
            elseif Config.Mode == "Infinity" then
                local inf = infinity(tParam)
                pos = Vector3.new(inf.X, Config.Height + inf.Y, inf.Z)
                
            elseif Config.Mode == "Star" then
                local st = star(tParam)
                pos = Vector3.new(st.X, Config.Height + st.Y, st.Z)
                
            elseif Config.Mode == "Helix" then
                local hx = helix(tParam, (i-1) / #hats * 2)
                pos = Vector3.new(hx.X, Config.Height + hx.Y, hx.Z)
            end
            
            -- Apply position and optional rotation
            if pos then
                local rotation = Config.RotateHats and CFrame.Angles(0, tParam, 0) or CFrame.new()
                handle.CFrame = hrp.CFrame * CFrame.new(pos) * rotation
            end
            
            -- RGB Mode: change hat color
            if Config.RGBMode and handle:IsA("MeshPart") then
                handle.Color = getRGBColor(now + i * 0.2)
            end
            
            -- Update trail color (RGB or default)
            if Config.ShowTrails and hatTrails[handle] then
                if Config.RGBMode then
                    hatTrails[handle].Color = ColorSequence.new(getRGBColor(now + i * 0.2))
                else
                    hatTrails[handle].Color = ColorSequence.new(Color3.fromRGB(255, 100, 150))
                end
            end
        end
    end
end)

--// ═══════════════════════════════════════════════════════════════
--//   CHAT COMMANDS SYSTEM
--// ═══════════════════════════════════════════════════════════════

-- Print help information
local function printHelp()
    print("\n╔════════════════════════════════════════╗")
    print("ā•‘       HEART ORBIT COMMANDS HELP        ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ MAIN COMMANDS:                         ā•‘")
    print("ā•‘  .orbit on/off     - enable/disable    ā•‘")
    print("ā•‘  .orbit refresh    - reload hats       ā•‘")
    print("ā•‘  .orbit dir        - change direction  ā•‘")
    print("ā•‘  .orbit status     - show status       ā•‘")
    print("ā•‘  .orbit help       - show this help    ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ MODES:                                 ā•‘")
    print("ā•‘  .mode heart       - heart shape       ā•‘")
    print("ā•‘  .mode orbit       - circle orbit      ā•‘")
    print("ā•‘  .mode spiral      - spiral pattern    ā•‘")
    print("ā•‘  .mode wave        - wave pattern      ā•‘")
    print("ā•‘  .mode infinity    - infinity symbol   ā•‘")
    print("ā•‘  .mode star        - star pattern      ā•‘")
    print("ā•‘  .mode helix       - DNA helix         ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ VALUE SETTINGS:                        ā•‘")
    print("ā•‘  .height [num]     - set height        ā•‘")
    print("ā•‘  .scale [num]      - set scale         ā•‘")
    print("ā•‘  .speed [num]      - set speed         ā•‘")
    print("ā•‘  .radius [num]     - set radius        ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ EFFECTS:                               ā•‘")
    print("ā•‘  .rgb on/off       - RGB mode          ā•‘")
    print("ā•‘  .trails on/off    - trail effects     ā•‘")
    print("ā•‘  .rotate on/off    - hat rotation      ā•‘")
    print("ā•‘  .layer on/off     - multi-layer       ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ PRESETS:                               ā•‘")
    print("ā•‘  .preset giant     - giant heart       ā•‘")
    print("ā•‘  .preset fast      - fast orbit        ā•‘")
    print("ā•‘  .preset slow      - slow spiral       ā•‘")
    print("ā•‘  .preset crazy     - crazy wave        ā•‘")
    print("ā•‘  .preset mini      - mini heart        ā•‘")
    print("ā•‘  .preset double    - double layer      ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘ EXAMPLES:                              ā•‘")
    print("ā•‘  .mode heart                           ā•‘")
    print("ā•‘  .height 15                            ā•‘")
    print("ā•‘  .rgb on                               ā•‘")
    print("ā•‘  .preset giant                         ā•‘")
    print("ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•\n")
end

-- Print current status
local function printStatus()
    print("\n╔════════════════════════════════════════╗")
    print("ā•‘          CURRENT STATUS                ā•‘")
    print("╠════════════════════════════════════════╣")
    print("ā•‘  Effect: " .. (showEffect and "ON" or "OFF") .. string.rep(" ", 32 - (showEffect and 2 or 3)) .. "ā•‘")
    print("ā•‘  Mode: " .. Config.Mode .. string.rep(" ", 35 - #Config.Mode) .. "ā•‘")
    print("ā•‘  Hats: " .. #hats .. "/" .. Config.MaxHats .. string.rep(" ", 34 - #tostring(#hats) - #tostring(Config.MaxHats)) .. "ā•‘")
    print("ā•‘  Height: " .. Config.Height .. string.rep(" ", 32 - #tostring(Config.Height)) .. "ā•‘")
    print("ā•‘  Scale: " .. string.format("%.2f", Config.Scale) .. string.rep(" ", 33 - #string.format("%.2f", Config.Scale)) .. "ā•‘")
    print("ā•‘  Speed: " .. string.format("%.2f", Config.Speed) .. string.rep(" ", 33 - #string.format("%.2f", Config.Speed)) .. "ā•‘")
    print("ā•‘  Radius: " .. string.format("%.1f", Config.Radius) .. string.rep(" ", 32 - #string.format("%.1f", Config.Radius)) .. "ā•‘")
    print("ā•‘  Direction: " .. (Config.Clockwise and "CW" or "CCW") .. string.rep(" ", 29 - (Config.Clockwise and 2 or 3)) .. "ā•‘")
    print("ā•‘  RGB: " .. (Config.RGBMode and "ON" or "OFF") .. string.rep(" ", 34 - (Config.RGBMode and 2 or 3)) .. "ā•‘")
    print("ā•‘  Trails: " .. (Config.ShowTrails and "ON" or "OFF") .. string.rep(" ", 31 - (Config.ShowTrails and 2 or 3)) .. "ā•‘")
    print("ā•‘  Rotate: " .. (Config.RotateHats and "ON" or "OFF") .. string.rep(" ", 31 - (Config.RotateHats and 2 or 3)) .. "ā•‘")
    print("ā•‘  Multi-Layer: " .. (Config.MultiLayer and "ON" or "OFF") .. string.rep(" ", 26 - (Config.MultiLayer and 2 or 3)) .. "ā•‘")
    print("ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•\n")
end

-- Chat command handler
lp.Chatted:Connect(function(msg)
    local cmd = msg:lower()
    
    -- Main commands
    if cmd == ".orbit on" or cmd == ".heart on" then
        showEffect = true
        print("[āœ“] Effect enabled")
        
    elseif cmd == ".orbit off" or cmd == ".heart off" then
        showEffect = false
        print("[āœ“] Effect disabled")
        
    elseif cmd == ".orbit refresh" or cmd == ".heart refresh" then
        local count = collectHats()
        print("[āœ“] Refreshed: " .. count .. " hats collected")
        
    elseif cmd == ".orbit dir" or cmd == ".heart dir" then
        Config.Clockwise = not Config.Clockwise
        print("[āœ“] Direction: " .. (Config.Clockwise and "Clockwise" or "Counter-Clockwise"))
        
    elseif cmd == ".orbit status" or cmd == ".heart status" then
        printStatus()
        
    elseif cmd == ".orbit help" or cmd == ".heart help" or cmd == ".help" then
        printHelp()
        
    -- Mode commands
    elseif cmd:sub(1, 6) == ".mode " then
        local mode = cmd:sub(7)
        local modes = {
            heart = "Heart",
            orbit = "Orbit",
            circle = "Orbit",
            spiral = "Spiral",
            wave = "Wave",
            infinity = "Infinity",
            star = "Star",
            helix = "Helix"
        }
        if modes[mode] then
            Config.Mode = modes[mode]
            print("[āœ“] Mode: " .. Config.Mode)
        else
            print("[āœ—] Unknown mode. Use: heart, orbit, spiral, wave, infinity, star, helix")
        end
        
    -- Value settings
    elseif cmd:sub(1, 8) == ".height " then
        local val = tonumber(cmd:sub(9))
        if val then
            Config.Height = val
            print("[āœ“] Height: " .. val)
        else
            print("[āœ—] Invalid number")
        end
        
    elseif cmd:sub(1, 7) == ".scale " then
        local val = tonumber(cmd:sub(8))
        if val and val > 0 then
            Config.Scale = val
            print("[āœ“] Scale: " .. val)
        else
            print("[āœ—] Invalid number (must be > 0)")
        end
        
    elseif cmd:sub(1, 7) == ".speed " then
        local val = tonumber(cmd:sub(8))
        if val and val > 0 then
            Config.Speed = val
            print("[āœ“] Speed: " .. val)
        else
            print("[āœ—] Invalid number (must be > 0)")
        end
        
    elseif cmd:sub(1, 8) == ".radius " then
        local val = tonumber(cmd:sub(9))
        if val and val > 0 then
            Config.Radius = val
            print("[āœ“] Radius: " .. val)
        else
            print("[āœ—] Invalid number (must be > 0)")
        end
        
    -- Effect toggles
    elseif cmd == ".rgb on" then
        Config.RGBMode = true
        print("[āœ“] RGB Mode: ON")
        
    elseif cmd == ".rgb off" then
        Config.RGBMode = false
        print("[āœ“] RGB Mode: OFF")
        
    elseif cmd == ".trails on" then
        Config.ShowTrails = true
        collectHats()
        print("[āœ“] Trails: ON")
        
    elseif cmd == ".trails off" then
        Config.ShowTrails = false
        for _, trail in pairs(hatTrails) do
            if trail then pcall(function() trail:Destroy() end) end
        end
        table.clear(hatTrails)
        print("[āœ“] Trails: OFF")
        
    elseif cmd == ".rotate on" then
        Config.RotateHats = true
        print("[āœ“] Rotation: ON")
        
    elseif cmd == ".rotate off" then
        Config.RotateHats = false
        print("[āœ“] Rotation: OFF")
        
    elseif cmd == ".layer on" or cmd == ".multilayer on" then
        Config.MultiLayer = true
        print("[āœ“] Multi-Layer: ON")
        
    elseif cmd == ".layer off" or cmd == ".multilayer off" then
        Config.MultiLayer = false
        print("[āœ“] Multi-Layer: OFF")
        
    -- Presets
    elseif cmd:sub(1, 8) == ".preset " then
        local presetName = cmd:sub(9)
        if Presets[presetName] then
            for k, v in pairs(Presets[presetName]) do
                Config[k] = v
            end
            print("[āœ“] Preset applied: " .. presetName)
        else
            print("[āœ—] Unknown preset. Use: giant, fast, slow, crazy, mini, double")
        end
    end
end)

--// ═══════════════════════════════════════════════════════════════
--//   INITIALIZE & WELCOME MESSAGE
--// ═══════════════════════════════════════════════════════════════

print("\n╔════════════════════════════════════════╗")
print("ā•‘  ā¤ HEART ORBIT v3.0 COMMAND-ONLY ā¤   ā•‘")
print("╠════════════════════════════════════════╣")
print("ā•‘  Loaded successfully!                  ā•‘")
print("ā•‘  Accessories: " .. #hats .. "/10" .. string.rep(" ", 26 - #tostring(#hats)) .. "ā•‘")
print("ā•‘  Mode: " .. Config.Mode .. string.rep(" ", 35 - #Config.Mode) .. "ā•‘")
print("╠════════════════════════════════════════╣")
print("ā•‘  Type .orbit help for all commands     ā•‘")
print("ā•‘  Type .orbit status for current status ā•‘")
print("ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•\n")

Features & Information

šŸ“œ ALL COMMANDS: Main Commands: .orbit on - Enable effect .orbit off - Disable effect .orbit refresh - Reload all hats .orbit dir - Change direction (CW/CCW) .orbit status - Show current settings .orbit help - Show help menu Mode Commands: .mode heart - Heart shape .mode orbit - Circle orbit .mode spiral - Spiral pattern .mode wave - Wave pattern .mode infinity - Infinity symbol .mode star - Star pattern .mode helix - DNA helix Value Settings: .height [number] - Set height (example: .height 15) .scale [number] - Set scale (example: .scale 0.8) .speed [number] - Set speed (example: .speed 1.5) .radius [number] - Set radius (example: .radius 8) Effect Toggles: .rgb on/off - Toggle RGB color mode .trails on/off - Toggle trail effects .rotate on/off - Toggle hat rotation .layer on/off - Toggle multi-layer mode Quick Presets: .preset giant - Giant heart preset .preset fast - Fast orbit preset .preset slow - Slow spiral preset .preset crazy - Crazy wave preset .preset mini - Mini heart preset .preset double - Double layer preset Usage Examples: .mode heart .height 15 .scale 1.2 .rgb on .trails on .preset giant .orbit status
#FE

Community Comments (4)

crackahh999crackahh999Dec 12, 2025

Client side?

iguigu0iguigu0Dec 17, 2025

Is this worked on all games?

Replying to @iguigu0
Dastyr268Dastyr268Dec 29, 2025

@okayyesyodang no

MissksjMissksjMay 26, 2026

What command I say so it can do different orbit??

More Scripts for Free Client Script Executor *BACK*