I'm trying to make Ambiance for my game, whereas if you step outside a house, the wind sound will get louder. I have 2 bricks, one for lowering the volum and the other for increasing the volume. I already have a script to get the sound playing, however the script doesn't work. It's a local script inside the brick.
local parent = script.Parent
parent.Touched:connect(function(hit)
if hit and hit:findFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(hit) then
local p = game.Players:GetPlayerFromCharacter(hit)
local c = hit.Parent
local sound = p:findFirstChild("OutdoorAmbient")
if sound then
sound.Volume = 0.3
end
end
end)
Please note that someone gave me this script on the forums and told be it should be local.
EDIT: The sounds are located in the player's StarterGUI

2 comments
This shouldn't be a localscript
That still doesn't solve it?