Player touch part and song start playing doesn't work. The player must be the only one listing the music when he or she touch it, i mean like just their own not other players too only if they touch it too! Whats wrong? Am thankfull if someone can help me ;)
local sound = script.Parent.Sound
game.Players.PlayerAdded:connect(function (newPlayer)
repeat wait() until script.Parent.Parent.Parent:IsA("Player")
script.Parent.Touched:connect(function(p)
local human = game.Players:GetPlayerFromCharacter(p.Parent)
if human and not sound.IsPlaying then
sound:Play()
end
end)
end)

12 comments
The script have to be local and being into the part that the player touches? And the sound have to be in Startergui?
I don't understand that sentence. Touch scripts should never be local, because local scripts don't run in workspace. And why would sound be in StarterGui? Just leave it in the part, where you had it, because the script does the cloning into PlayerGui. Although you could put it in StarterGui, but we'd have to change some things in the script.
Ooh well, bc it doens't work ;/
It works. I tested it. You getting any output?
No i dont get any output it try differents ways its still not working..
Just put the Script and the Sound in the part of your choice.
Sorry, it works perfect i did add it in a wrong brick..
hmmm but how can i let it stop? and start a other song?
You just use the Stop() command, but that's a whole nother question, so accept this one if it helped please.
No problem i forgot too do sorry ;D
with the stop command the music keep going on and dont start the new one on the next part
Ask a new question on it with the new code you're using.