So if i put my intro music into the starter gui it always plays when you die/reset i've made this clone script only plays the music when you enter the game and never again.
local Sound = script.Sound:Clone() game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() Sound:Clone().Parent = player.PlayerGui wait(.1) Sound:Play().Parent = player.PlayerGui end)
The thing i want is: Let it clone to playergui which works, but doesn't play the sound. So the prob is i want to make it play when it clones the sound. Help pls...
Well, I believe sound only plays in two places: The Player & The Workspace. Sounds don't work in other places like the PlayerGui.
Workspace: Plays Sound For Everyone
player.Sound:Play()
The Player: Plays sound for ONE person only.
workspace.Sound:Play()
Maybe you want to do this, instead of putting the sound in the GUI, put it in the player.
local Sound = script.Sound:Clone() game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() Sound:Clone().Parent = player wait(.1) Sound:Play().Parent = playeri end)
Your problem is that you have incorrect syntax.
Sound:Play().Parent
is not correct syntax.
I'm assuming what you want to happen is that the sound is cloned into the playergui and then the sound plays after 0.1 seconds. I would suggest setting the clone of the sound to a local variable, and then setting that variable's parent to the playergui, and then after 0.1 seconds make the variable play, like so:
local soundClone = Sound:Clone() soundClone.Parent = player.PlayerGui wait(0.1) soundClone:Play()
Hope this helped!