I have come a long way for my game, but I ran across an issue with my music that is in my game. In the Roblox Studio, I added a brick that has a transparency of one and plays music who ever comes into contact with it. The problem is that the music plays in the Studio, but as I test it in the live game, it does not play at all. Does anyone have any solutions on how to fix this? Here is the script by the way, (They are two separate ones both included into the part.
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid')then
game.Players[hit.Parent.Name].PlayerGui.Sound3.Volume = 1
game.Players[hit.Parent.Name].PlayerGui.Sound3:Play()
end
end)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Second Script)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
script.Parent.TouchEnded:connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid')then
game.Players[hit.Parent.Name].PlayerGui.Sound3.Volume = 0
end
end)
Almost forgot to mention that my sounds are in my StarterGui, I have three of them each labeled Sound but with different numbers (Sound1, Sound2, and Sound3). Each Sound has the same scripts as the ones above.

5 comments
Is your game filtering enabled?
Format your code correctly
Make sure to try without square brackets and refer to the player a different way instead in case that is the issue.
Enabling filtering = Did not work.
I tried the code with sqaure brackets as well, but that just made it not work in both the Studio and the live game. I know it is possible for the music to play in the live game too, just struggling on how to fix this.