I am using this script but its not working, please someone help. I have asked this question before (look at my scriptinghelpers profile.) https://scriptinghelpers.org/questions/86852/how-do-you-change-particle-size-based-of-playbackloudness
Script:
local sound = workspace.Sound if sound.IsPlaying then script.Parent.Fire.Size = 0.5-((sound.PlaybackLoudness/1000)*1) end
Try this on for size. Put this in a LocalScript in StarterPlayerScripts. Also make sure to set the sound
and fire
variables to point to the right places in your Workspace.
local sound = game.Workspace.Sound local fire = game.Workspace.Part.Fire -- a ParticleEmitter while true do if sound.IsPlaying then local number = (sound.PlaybackLoudness / 80) * (1 + sound.Volume) print(number) fire.Enabled = true fire.Size = NumberSequence.new(number) fire.Speed = NumberRange.new(number + 10) else fire.Enabled = false end wait() end
I found that using a regular Script wasn't able to read the changes in the sound's PlaybackLoudness
, IsPlaying
, Playing
and TimePosition
properties. This might be due to the sound actually being played on the client, even though the sound itself is in Workspace.
Also, the Changed
event and the GetPropertyChangedSignal
method did not work on PlaybackLoudness
, IsPlaying
, Playing
or TimePosition
. I wonder if this is a bug or some intentional behavior in the Roblox engine.