What that line is supposed to do is if PlaybackLoudness = 0 then it makes volume = .1 instead of 0.
That makes it so that when you use
part.Size = Vector3.new(sound.PlaybackLoudness/5, sound.PlaybackLoudness/5, sound.PlaybackLoudness/5);
it doesn’t allow sound.PlaybackLoudness/5
or 0/5 so it will stop your math issue of dividing 0 by 5 from happening because .1/5 = .02
The line isn’t supposed to change your size by much.
I understand, however, why isn’t the ball not resizing still? I did what you advised me to do, and it’s still staying like that. I’ll send you my script.
local part = Instance.new("Part",game.Workspace)
local mesh = Instance.new("SpecialMesh",part)
local by = Instance.new("BodyVelocity",part)
local sound = Instance.new("Sound",part)
part.Size = Vector3.new(1,1,1)
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.fromRGB(255, 255, 255)
part.Material = Enum.Material.Neon
part.Anchored = false
part.CanCollide = false
mesh.MeshType = Enum.MeshType.Sphere
part:SetNetworkOwner(nil)
by.MaxForce = Vector3.new(999999999999,999999999999,999999999999)
by.Velocity = Vector3.new(0,0,0)
sound.Name = "Audio"
sound.SoundId = "rbxassetid://280225750"
sound.Looped = true
sound:Play()
volume = sound.PlaybackLoudness + .1
while task.wait() do
part.Size = Vector3.new(volume/5, volume/5, volume/5);
end
I’m pretty sure it’s because you only set volume
once before the loop.
Try putting volume = sound.PlaybackLoudness + .1
inside the loop.
Network ownership doesn’t replicate the size of the part
You can just fire a remote with the playback loudness and let the server change the size
How exactly would I do that? A link to a devforum is fine.
Still stuck like that
lets try focus on the ball sizing first then we can deal with the server stuff later.
I have no clue how Void Script Builder’s script running works, but I’m assuming it runs it in the server side. If you want this to work, you’d have to make it run from the client/LocalScript
The thing is, the server sees the PlaybackLoudness as 0, while the client sees an actual number.
Why? Because if the server could see it, it might be out of sync with all the other’s clients audio, some may be delayed and whatnot. All of the clients’ audio have the possibility of being out of sync, depending on their ping or a small one second delay or their audio is still loading.
So this is why it should be a LocalScript/client sided
It’s probably impossible to achieve this in Void Script Builder, unless the game supports LocalScripts.
I tested it on a local script and it still appears to not resize too
Yes, but you have to use a local script and research how to (as @heII_ish posted) “fire a remote with the playback loudness and let the server change the size”.
Is there any errors in the output? Also
You can’t call :SetNetworkOwner
in the Client or else it’ll error
That’s the part where it confuses me, because if I’m wanting to run this through one script, how would I be able to fit a local and server script inside one since I’m testing this in void script builder?
Also, can we please get back to how to scale the sphere using playbackloudness? Extremely sorry, but no one else has covered this using a sphere and not a normal part.
It is possible on Void script builder since I’ve seen people do it. They’ve told me they’ve done it using netownership and remotes. It is also possible to run local scripts too in the game.
As always check out developer.roblox.com
Bindable Events and Functions | Roblox Creator Documentation
Void sb had a function in the script’s environment that let you run local scripts from a server script
I believe it was something like this
NLS[[
print(game.Players.LocalPlayer)
]]