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

I tried playbackloudness it did not work for me?

Asked by 3 years ago

wait(1) local player = game.Players.LocalPlayer local character = player.Character local button = script.Parent.Button local Frame = script.Parent.Frame local playButton = Frame.PlayButton local stopButton = Frame.StopButton local pauseButton = Frame.PauseButton local idBox = Frame.IdBox local radio = script.Parent.Radio local open = false

button.MouseButton1Click:connect(function() if open == false then open = true Frame.Visible = true local newRadio = radio:Clone() newRadio.Parent = character newRadio.CFrame = character.Torso.CFrame * CFrame.Angles(0,math.pi,0) -- or Torso if you use R6 local weld = Instance.new("Weld") weld.Part0 = newRadio weld.Part1 = character.Torso weld.C0 =newRadio.CFrame:inverse() weld.C1 = character.Torso.CFrame:inverse() weld.Parent = newRadio

else
    open = false
    character.Radio:Destroy()
    Frame.Visible = false
end

end)

idBox.Changed:connect(function() character.Radio.Sound:Stop() character.Radio.Sound.SoundId = ('rbxassetid://'..idBox.Text) end)

playButton.MouseButton1Click:connect(function() character.Radio.Sound:Play() end)

stopButton.MouseButton1Click:connect(function() character.Radio.Sound:Stop() end)

pauseButton.MouseButton1Click:connect(function() character.Radio.Sound:Pause() end)

script.Parent.Sound:Play()

while true do vol = script.Parent.Sound.PlaybackLoudness script.Parent.Radio.Part = Vector3.new(1,vol/20,1) wait() end

Answer this question