Fe Hat Orbit Script | Trusted – 2026 |
angle = angle + speed * dt if angle > math.pi * 2 then angle = angle - math.pi * 2 end
local y = heightOffset + math.sin(angle * 2) * 0.5 Store hats in a table and assign each a phase offset: FE Hat Orbit Script
local radiusX = 4.0 local radiusZ = 2.0 local x = math.cos(angle) * radiusX local z = math.sin(angle) * radiusZ Add sine wave to Y-axis: angle = angle + speed * dt if angle > math
local function orbitUpdate() angle = angle + speed * tick() local x = math.cos(angle) * radius local z = math.sin(angle) * radius local relativeCF = CFrame.new(x, heightOffset, z) hatHandle.CFrame = targetPart.CFrame * relativeCF end FE Hat Orbit Script
connection = game:GetService("RunService").RenderStepped:Connect(orbitUpdate) return connection -- to disconnect later end
-- Orbit update function local function updateOrbit() local now = os.clock() local dt = now - lastUpdate lastUpdate = now
-- Apply new CFrame to hat handle hat.Handle.CFrame = newCFrame end