I tried putting everywhere the sound ID and even as parent, i want to make when you touch a Part that you can hear a sound, idk where to put the sound id or something... This is the script i wrote and i am having trouble fixing.
script.Parent.Touched:connect(function(hit) script.Parent.Sound:Play() end)
If someone helps me, i will be so thankful! :D
script.Parent.Touched:connect(function(hit) script.Parent.Sound:Play() end)
If your script looks something like that it should work, and I do not see why it wouldn't unless it is an issue with the sound value, nothing hitting the part, etc. But I do believe the scripting looks ok.
Since I do not know if you want the sound played to be local, I will assume so. You want to put the object "Sound" inside of StarterGui, so it gets auto moved to PlayerGui when the player joins.
This is what I use, but with a few other thing, which is not nessesary for it work.
Local brick = (put the brick that you want to be touched in here) brick.Touched:connect(function(hit) If hit.Parent:FindFirstChild("Humanoid") then local A = Game.Players[hit.Parent.Name]:FindFirstChild("PlayerGui") If A then A.Sound:Play() end end end)
Unless I made a type, it should work.
Be sure to change the sound play the music you want.