---
title: "Hat orbit | Universal Roblox Script - ScriptBlox"
description: "Hat orbit for any Roblox game: Hat orbit"
canonical_url: "https://scriptblox.com/script/Universal-Script-Hat-orbit-58873"
meta:
  "og:description": "Hat orbit for any Roblox game: Hat orbit"
  "og:image": "https://scriptblox.com/images/script/0-1760664578705.jpg"
  "og:title": "Hat orbit | Universal Roblox Script - ScriptBlox"
  "twitter:description": "Hat orbit for any Roblox game: Hat orbit"
  "twitter:image": "https://scriptblox.com/images/script/0-1760664578705.jpg"
  "twitter:title": "Hat orbit | Universal Roblox Script - ScriptBlox"
---

> Index of every page on this site: [llms.txt](https://scriptblox.com/llms.txt)

![Universal Script 📌](https://scriptblox.com/images/script/0-1760664578705.jpg)

# **Hat orbit**

[**Universal Script 📌**](https://scriptblox.com/game/universal)**![normspence34](https://scriptblox.com/images/user-default.webp) [normspence34](https://scriptblox.com/u/normspence34)First script**

1 year ago

[**Get an executor**](https://scriptblox.com/executors?kind=executor)

Please login to perform these actions:

## **Does it work? **

**No reports yet **

No reports yet. Tried it? Be the first to say.

Also noticed:

## Description

Hat orbit

[View Raw](https://scriptblox.com/raw/Universal-Script-Hat-orbit-58873)

```
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hat = game.Workspace:WaitForChild("Hat") -- Replace with the name of your hat
local head = character:WaitForChild("Head")

-- Parameters
local radius = 5    -- Orbit radius
local speed = 1     -- Speed of the orbit
local offset = Vector3.new(0, 5, 0)  -- Adjust the Y offset if you want the hat higher or lower

-- Variables for controlling the orbit
local angle = 0
local orbiting = true
local mode = "orbit"  -- Default mode is 'orbit'

-- Function to handle mode changes
local function setMode(newMode)
    mode = newMode
    print("Mode changed to: " .. mode)
end

-- Main loop to animate the hat
while true do
    if mode == "orbit" then
        -- Orbit Mode
        local x = math.cos(angle) * radius
        local z = math.sin(angle) * radius
        hat.CFrame = head.CFrame * CFrame.new(x, offset.Y, z)
        angle = angle + speed * math.rad(1)
    
    elseif mode == "bounce" then
        -- Bounce Mode (Vertical bounce up and down)
        local time = tick()
        local y = math.sin(time * speed) * 5  -- Change '5' to control bounce height
        hat.CFrame = head.CFrame * CFrame.new(0, offset.Y + y, 0)
    
    elseif mode == "spin" then
        -- Spin Mode (Spin around player's head)
        local time = tick()
        local rotation = math.rad(time * 100)  -- Adjust speed of spinning


```

## **Comments **

**0**

Log in to join the conversation. [**Login **](https://scriptblox.com/login?redirect=/script/Universal-Script-Hat-orbit-58873)

No comments yet. Be the first!

```json
{"@context":"https://schema.org","@type":"SoftwareSourceCode","@id":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873#script","url":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873","name":"Hat orbit","programmingLanguage":"Lua","runtimePlatform":"Roblox","author":{"@type":"Person","name":"normspence34","url":"https://scriptblox.com/u/normspence34"},"datePublished":"2025-10-17T01:29:38.721Z","image":"https://scriptblox.com/images/script/0-1760664578705.jpg","isAccessibleForFree":true}
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scriptblox.com/#website","@type":"WebSite","description":"Search free Roblox scripts uploaded by the community, with live status for every major executor. Browse by game, copy the loadstring and run it in your executor.","inLanguage":"en","name":"ScriptBlox","url":"https://scriptblox.com/"},{"@id":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873#webpage","@type":"WebPage","description":"Hat orbit for any Roblox game: Hat orbit","name":"Hat orbit | Universal Roblox Script - ScriptBlox","url":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873","breadcrumb":{"@id":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873#breadcrumb"},"isPartOf":{"@id":"https://scriptblox.com/#website"},"mainEntity":{"@id":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873#script"},"potentialAction":[{"@type":"ReadAction","target":["https://scriptblox.com/script/Universal-Script-Hat-orbit-58873"]}]},{"@id":"https://scriptblox.com/script/Universal-Script-Hat-orbit-58873#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://scriptblox.com","position":1},{"@type":"ListItem","name":"Universal","item":"https://scriptblox.com/game/universal","position":2},{"@type":"ListItem","name":"Hat orbit","position":3}]}]}
```

## Sitemap

See the full [sitemap](https://scriptblox.com/sitemap.md) for all pages.
