hi, im trying to make sound environment scripts for my game but they only seem to work in studio mode and not in the actual game and when i jump the song repeats (i was using R6.) i used a localscript and placed them all in the StarterGui. i also put both of the sounds in the StarterGui. here is the code i got from a youtube tutorial:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')then game.Players[hit.Parent.Name].PlayerGui.Sound2.Volume=1 game.Players[hit.Parent.Name].PlayerGui.Sound2:Play() game.Players[hit.Parent.Name].PlayerGui.castlemusic:Stop() end end)
that script was to have Sound2 play when you walk into the house and for the castlemusic to stop. thanks in advance. from poopypigeon245