Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
3F1VE 257 Moderation Voter
3 years ago
Edited 3 years ago

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  
0
btw its a audio visualizer 3F1VE 257 — 3y

1 answer

Log in to vote
1
Answered by
Sparks 534 Moderation Voter
3 years ago
Edited 3 years ago

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).

0
Thank you! I converted it to a local script in StarterGui and it worked! 3F1VE 257 — 3y
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. Sparks 534 — 3y
0
ok well i moved it from starter gui to replicated first 3F1VE 257 — 3y
Ad

Answer this question