Roblox Has The Same thing and they do it with guis too. Here is my script it uses four different ones and makes it look like a sound wave while playing an audio I made!
03 | local Players = game:GetService( "Players" ) |
04 | local LocalPlayer = Players.LocalPlayer |
05 | local bar 1 = game.Workspace.AudioSpectrum.Part 1 |
06 | local bar 2 = game.Workspace.AudioSpectrum.Part 2 |
07 | local bar 3 = game.Workspace.AudioSpectrum.Part 3 |
08 | local bar 4 = game.Workspace.AudioSpectrum.Part 4 |
09 | local bar 5 = game.Workspace.AudioSpectrum.Part 5 |
10 | local bar 6 = game.Workspace.AudioSpectrum.Part 6 |
11 | local bar 7 = game.Workspace.AudioSpectrum.Part 7 |
12 | local bar 8 = game.Workspace.AudioSpectrum.Part 8 |
13 | local sound = Instance.new( "Sound" ) |
14 | local maxLoudness = 75000 |
16 | bar 1. Size = Vector 3. new( 1 , 1 , 1 ) |
17 | bar 2. Size = Vector 3. new( 1 , 1 , 1 ) |
18 | bar 3. Size = Vector 3. new( 1 , 1 , 1 ) |
19 | bar 4. Size = Vector 3. new( 1 , 1 , 1 ) |
20 | bar 5. Size = Vector 3. new( 1 , 1 , 1 ) |
21 | bar 6. Size = Vector 3. new( 1 , 1 , 1 ) |
22 | bar 7. Size = Vector 3. new( 1 , 1 , 1 ) |
23 | bar 8. Size = Vector 3. new( 1 , 1 , 1 ) |
27 | sound.Parent = game.Workspace.AudioSpectrum |
29 | sound.PlaybackSpeed = 1.1 |
32 | local amplitude = math.clamp(sound.PlaybackLoudness / maxLoudness, 0 , 0.5 ) |
33 | bar 1. Size = Vector 3. new( 0.5 , amplitude * 5000 , 0.5 ) |
35 | bar 2. Size = Vector 3. new( 0.5 , amplitude * 4000 , 0.5 ) |
37 | bar 3. Size = Vector 3. new( 0.5 , amplitude * 6000 , 0.5 ) |
39 | bar 4. Size = Vector 3. new( 0.5 , amplitude * 3000 , 0.5 ) |
41 | bar 5. Size = Vector 3. new( 0.5 , amplitude * 4000 , 0.5 ) |
43 | bar 6. Size = Vector 3. new( 0.5 , amplitude * 5000 , 0.5 ) |
45 | bar 7. Size = Vector 3. new( 0.5 , amplitude * 2000 , 0.5 ) |
47 | bar 8. Size = Vector 3. new( 0.5 , amplitude * 5000 , 0.5 ) |
Closed as Non-Descriptive by zblox164, IcyEvil, yHasteeD, 1TheNoobestNoob, DeceptiveCaster, and Lugical
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?