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)

4 comments

1

Whats the error say?

0

^ 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)

0

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?