Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

{ANSWERED} I made a visualizer script. How do i make it so it works?

This is the script so far. I want to make it inside workspace but the size is not changing. btw the scriptype is not a local script. its a normal

local oof = Instance.new("WorldModel",workspace)
oof.Name = "Visualizer"
local p = Instance.new("Part",oof) 
local s = Instance.new("Sound",p) 
p.Anchored = true
p.Position = Vector3.new(-51.615, 0.055, 88.5) 
s.SoundId = "rbxassetid://478553966" 
s.Playing = true 
s.Looped = true 
p.Shape = Enum.PartType.Cylinder 
p.Orientation = Vector3.new(0, 180, -90) 
repeat wait() 
p.Size = Vector3.new(0.15, s.PlaybackLoudness/15, s.PlaybackLoudness/15) 
until nil == 1  

1 comment

0

btw its a audio visualizer

1 answer

✓ Accepted answer

PlaybackLoudness is not replicated across the server/client boundary. Because the server isn't playing the sound itself (sounds are always played on client), you will have to get the PlaybackLoudness in a local script. It is probable that PlaybackLoudness is always 0 on the server so the size stays at (0.15,0,0).

3 comments

0

Thank you! I converted it to a local script in StarterGui and it worked!

0

The problem with making it a localscript is that if this is some kind of boombox or object parented to workspace, the visualizer will only be visible for the client. You can try using a remoteevent to tell the server the current PlaybackLoudness so that it can update the visualizer for each player in a way that is replicated to all clients.

0

ok well i moved it from starter gui to replicated first

This discussion is preserved as it was. New answers, comments, and votes are closed.