This script play a sound when the player touch a part, the script works on roblox studio, but it doesn't work in game.
script.Parent.Touched:connect(function() if game.SoundService.Sound.IsPlaying == false then game.SoundService.Sound:Play() elseif game.SoundService.Sound.IsPlaying == true then end end)
Make sure instead of script its a LocalScript, also to make the sound ONLY play on one's game instead of the whole server you would have to make the Sound in StarterGui and replace some code with this
script.Parent.Touched:connect(function(part) if game.PlayerGui.Sound.IsPlaying == false then game.Players[part.Parent.Name].PlayerGui.Sound:Play() elseif game.PlayerGui.Sound.IsPlaying == true then end end)
This also makes it work, you forgot to put (part) after function in parentheses