I have an issue where I keep getting 0 when I print the playbackloudness of the sound
My script:
local neonpart = script.Parent.neon
local unneonpart = script.Parent.unneon
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local visible = TweenService:Create(neonpart, tweenInfo, {Transparency=0})
local unvisible = TweenService:Create(neonpart, tweenInfo, {Transparency=1})
local sound = game:GetService("Workspace").Sound.Sound
sound:Play()
while wait(.05) do
local loudness = sound.play
print(tostring(sound.PlaybackLoudness))
if sound.PlaybackLoudness>sound.Volume then
visible:Play()
wait(1)
end
end
hope you could help me thank u