for example, i wanna add this icy side to my game, and this firey side to my game, but i want it to where once you step from the icy side to the fire side (or vice versa) it plays a different song
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.
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume = 1 game.Players[hit.Parent.Name].PlayerGui.Sound1:Play() -- Sound1 = the sound print('PlayerHasEntered') script.Disabled = true script.Parent.Off.Disabled = false end end)
Next is the player exited music script
script.Parent.TouchEnded:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume = 0 -- This will silent the music. print('PlayerHasExited') script.Disabled = true script.Parent.On.Disabled = false end end)
Try this.