Hello, I made a script so when a boss spawns and it dies, a victory music plays. The music wont stop though. any help please? I want it to play once. would appreciate any help
(server script and not a local one)
local function spawnEnemy(character,cf)
local music = game.Workspace.music
local npc = character:Clone()
local humanoid = npc.Humanoid
local torso = npc.Torso
npc.Parent = workspace
npc:MakeJoints()
torso.CFrame=cf
humanoid.Died:connect(function()
music.SoundId = "rbxassetid://10807323565"
music.PlaybackSpeed = 1
music:Stop()
wait(1)
npc:Destroy()
end)

2 comments
Add a print after humanoid.Died:connect(function(), see if its printing
I wrote, print("printed this message") underneath humanoid.Died:connect(function() and it prints out in console when the sound plays. Any other suggestions?