local AMOUNT = 40 local BASE_DISTANCE = 7 local HEIGHT = 1 local SIZE = Vector3.new(0.3, 0.3, 0.3) local BEAT_FORCE = 0.012 local SMOOTHING = 0.35 local COLOR_SPEED = 0.15 local PASTEL_SATURATION = 0.35 local PASTEL_BRIGHTNESS = 1 local Players = game:GetService("Players") local RunService = game:GetService("RunService") local SoundService = game:GetService("SoundService") local player = Players.LocalPlayer local character local root local diamonds = {} local currentDistance = BASE_DISTANCE local colorTime = 0 for i = 1, AMOUNT do local part = Instance.new("Part") part.Size = SIZE part.Anchored = true part.CanCollide = false part.Material = Enum.Material.Neon part.Parent = workspace diamonds[i] = { part = part, angle = (math.pi * 2 / AMOUNT) * i, colorOffset = i / AMOUNT } end local function setCharacter(char) character = char root = character:WaitForChild("HumanoidRootPart") end if player.Character then setCharacter(player.Character) end player.CharacterAdded:Connect(setCharacter) local function getLoudness() local loudness = 0 for _, obj in ipairs(workspace:GetDescendants()) do if obj:IsA("Sound") and obj.IsPlaying and obj.Volume > 0 then loudness = math.max(loudness, obj.PlaybackLoudness) end end for _, obj in ipairs(SoundService:GetDescendants()) do if obj:IsA("Sound") and obj.IsPlaying and obj.Volume > 0 then loudness = math.max(loudness, obj.PlaybackLoudness) end end return loudness end RunService.RenderStepped:Connect(function(dt) if not root then return end local loudness = getLoudness() colorTime += dt * COLOR_SPEED local target = BASE_DISTANCE - (loudness * BEAT_FORCE) target = math.clamp(target, BASE_DISTANCE - 2, BASE_DISTANCE) currentDistance += (target - currentDistance) * SMOOTHING for _, data in ipairs(diamonds) do local x = math.cos(data.angle) * currentDistance local z = math.sin(data.angle) * currentDistance local hue = (colorTime + data.colorOffset) % 1 data.part.Color = Color3.fromHSV(hue, PASTEL_SATURATION, PASTEL_BRIGHTNESS) data.part.CFrame = CFrame.new(root.Position + Vector3.new(x, HEIGHT, z)) * CFrame.Angles(math.rad(45), math.rad(45), 0) end end)