Music visualizer doesn't work in server ?
Asked by
7 years ago Edited 7 years ago
This is a server script that controls the visualizer. It works in studio, but in a server it only plays the music. Help ?
01 | local visualizer = script.Parent.Parent |
02 | local div = script.base_divisor.Value |
04 | local songInfoGui = visualizer.box.songPlaying.SurfaceGui |
07 | math.randomseed(tick()*math.random()) math.random() |
08 | song = visualizer.list.emit:GetChildren() [ math.random(#visualizer.list.emit:GetChildren()) ] |
14 | local Asset = game:GetService( "MarketplaceService" ):GetProductInfo(string.sub(song.SoundId, 14 )) |
15 | songInfoGui.songName.Text = "Playing : " .. Asset.Name |
17 | songInfoGui.songTime.Text = math.floor(song.TimeLength - song.TimePosition) |
18 | for _, part in pairs (visualizer.p:GetChildren()) do |
19 | local PartPosition = part.Position |
20 | part.Size = Vector 3. new(part.Size.X, (song.PlaybackLoudness/div)/(part.num.Value), part.Size.Z) |
21 | part.CFrame = CFrame.new(PartPosition) |
22 | part.Color = Color 3. fromHSV(part.Size.Y* 2 ,part.Size.Y* 2 ,part.Size.Y* 2 ) |