You could use these two scripts
BTW, you will want to make an invisible part around that
area you want the music/sound you want it to be in, (Ex. Icy Area)
This script activates when a player touches the invisible part, in
this case the player enters the certain area.
Also, add the sounds you want in the startergui.
That's the player entered music script.
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit.Parent:FindFirstChild( 'Humanoid' ) then |
3 | game.Players [ hit.Parent.Name ] .PlayerGui.Sound 1. Volume = 1 |
4 | game.Players [ hit.Parent.Name ] .PlayerGui.Sound 1 :Play() |
5 | print ( 'PlayerHasEntered' ) |
7 | script.Parent.Off.Disabled = false |
Next is the player exited music script
1 | script.Parent.TouchEnded:Connect( function (hit) |
2 | if hit.Parent:FindFirstChild( 'Humanoid' ) then |
3 | game.Players [ hit.Parent.Name ] .PlayerGui.Sound 1. Volume = 0 |
4 | print ( 'PlayerHasExited' ) |
6 | script.Parent.On.Disabled = false |
Try this.