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

Audio script wont work? (Filtering enabled??)

Asked by 4 years ago

This is a local script, inside of a button, the names of the buttons are all correct and it will print the "1" but nothing else, the volume is set right i dont know whats wrong...? (I want the audio to turn off once clicked) Could somebody fix this script:

local Player = game:GetService('Players').LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui')
local music = PlayerGui.Menu.Sound2
PlayerGui.Menu.Main_Menu.Menu_Background.Play_Button.Button.MouseButton1Click:Connect(function()
  print ("1")
if music.Volume == 0.2 then
    print ("2")
    music.Volume = 0
    print ("3")
end
end)

0
What exactly are you trying to do with this? Is the volume set to 0.2 (Exactly)? Do you get any errors when running it? pengalu200 65 — 4y
0
Is "Sound2" a TextBox? Maximus1027 30 — 4y
0
Sound 2 is a audio, and yes the volume is exactly 0.2 killerbrasko2002 33 — 4y

Answer this question