✓ Accepted answer
At line 1-2:
local player = game.Players.LocalPlayer.Aviici
local sound = player.Aviici
You already set player as the sound. So at line 2, the script will see if there's a other sound inside the sound on player.
In line 6 and 11, it's when the script will get confused. In scripting, you need to understand, you don't use a variable and a other variable to locate something. For example
local x = script.Parent
local y = x.Parent
x.y.BrickColor = BrickColor.new("Really black")
y.BrickColor = BrickColor.new("Really black")
So your script would be:
local player = game.Players.LocalPlayer
local sound = player.Aviici
function Click()
sound.Volume = 0
end
function Click()
sound.Volume = 0.25
end
script.Parent.MouseButton1Down:connect(Click)
script.Parent.MouseButton1Down:connect(Click)
IMPORTANT TIP: Use Output. It will say the errors you cause.
1 comment
I have a script in my game to where you can hit the "m" key and it mutes music. However it is complicated and the right circumstances need to be met.