local aplayerdied = game.ReplicatedStorage.playerhasdied
aplayerdied.OnServerEvent:connect (function(plr)
local music = Instance.new("Sound",plr.Head)
music.IsPlaying = true
music.Playing = true
music.SoundId = "rbxassetid://1321997558"
music.Volume = 1
music.MaxDistance = 100
music.EmitterSize = 10
wait "1"
music:Destroy()
end)
COMMUNITY QUESTION
Why do i get an error on the 5th line when making a new sound in the head?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Whats the error say?
http://wiki.roblox.com/index.php?title=API:Class/Instance/WaitForChild
^ Adding onto, if it's an error about something not loading, take this page into consideration too: http://wiki.roblox.com/index.php?title=Character (For when a scripts loads before the object's there)
Just curious, but it seems like you made a function that runs when a player dies. Why would you need to use remote events for this when you can just use Humanoid.Died?