For instance, I want a lobby sound file active only when I'm in the lobby, and when I get teleported to another location (outside the lobby), I want the script to change the volume of that audio file to 0.
Does anyone have any clue how to make this work?
Well for this, there are multiple ways,
One way is to make the sound play within a brick that's within the room.
Another way is you could insert a sound into the playergui and play depending on whatever brick they're touching.
Now the first one is pretty self explanatory but I should explain the second one.
Now like @Mokiros said, You could use touch events, For this we should put the sound in the player gui, so...
game.Players.PlayerAdded:connect(function(plr) local audio = Instance.new("Sound") audio.Parent = game.Workspace[plr.Name] end)
Now that we've set up where the audio is, We can now change it with an touched event,
game.Players.PlayerAdded:connect(function(plr) local audio = Instance.new("Sound") audio.Parent = game.Workspace[plr.Name] audio.Name = "LocalAudio" game.Workspace.'Partname here'.Touched:connect(function() game.Players[plr.Name].PlayerGui.LocalAudio.SoundId = "Sound id here" game.Players[plr.Name].PlayerGui.LocalAudio:Play() end) end)