Earlier today a friend of mine requested a few scripts, and I went ahead and made them because I've only started cracking down on learning Lua earlier this year and really needed the practice.
One of these scripts was pretty simple - make a sound play when a part is touched. After a while I had whipped this up.
local playing = false
function MakeSound()
if playing == false then
local sound = Instance.new("Sound")
sound.Parent = script.Parent
sound.SoundId = "http://www.roblox.com/asset/?id= " --Sound ID goes here
sound:Play()
playing = true
wait(1)
playing = false
sound:Destroy() --can't leave all these played sounds laying around
elseif playing == true then return
end
end
script.Parent.Touched:connect(MakeSound)
For some reason it worked in solo, but not online. I realized I over-complicated it so I changed it to simply play a pre-existing sound when touched, and now it works online.
But I'm curious just in case this problem ever arises again in my scripts... what IS the problem? Why'd it work in solo but not online?

5 comments
Did you forget to append a soundId on line 7?
Even with a SoundId set it worked in solo, but not online when we tested it. Also I feel like I didn't make it clear but I have a fix, it's just I don't know why this over-complicated iteration of it didn't work online.
Is it activating or not (ex: sound is not being created)?
I'm not sure, is there any kind of in-game explorer so I can see what it's doing online?
Well thanks for trying to help me understand what's wrong, but considering someone here described a very similar problem I'm just going to chalk it up as being a quirk with sound.