I have a sound that is parented to a player when they join a game:
local sound = SoundService:WaitForChild("TheSound")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local soundClone = sound:Clone()
soundClone.Name = "SoundSound"
soundClone.Parent = player
end)
end)
And then later played via a sever-script:
if game.Players:FindFirstChild(player.Name):FindFirstChild("SoundSound") then
game.Players:FindFirstChild(player.Name):FindFirstChild("SoundSound"):Play()
end
The sound plays fine when I manually play it in Studio, however, it doesn’t in-game.
if game.Players:FindFirstChild(player.Name):FindFirstChild("SoundSound") then
print("TEST")
game.Players:FindFirstChild(player.Name):FindFirstChild("SoundSound"):Play()
end
The player.CharacterAdded:Connect(function(character)) fires when the Character fully loads. So, I want the game to add the Sound to the player once his Character fully-loads.
You’re parenting the sound under the player instance, sounds don’t work unless they’re are a descendant of the workspace. So you should patent it to the character model instead.