Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script that puts a sound for when player dies?

Hi, how would it be possible so that after HumanoidHealth reaches 0, the player who died gets a Sound to play, only for them? I don't think Humanoid.Died exists anymore so my only alternative is this. ^^^^

Thanks so much.

1 comment

0

Lolw Humanoid.Died does exist.

1 answer

-- localscript
local sound = ""
-- Please put the sound Id in the "" above.
game:GetService("Players").PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
			local DeathSound = Instance.new("Sound", character.Head)
			DeathSound.SoundId = sound
			DeathSound.Volume = 1
			DeathSound.MaxDistance = 10000000000000000
		end)
	end)
end)

the died function still exists

if it doesn't exist then do this..

-- localscript Again....
local sound = ""
-- Please put the sound Id in the "" above.
game:GetService("Players").PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid"):connect(function()
			if character.Humanoid.Health.Value < 1 then
				local DeathSound = Instance.new("Sound", character.Head)
				DeathSound.SoundId = sound
				DeathSound.Volume = 1
				DeathSound.MaxDistance = 10000000000000000
			end
		end)
	end)
end)

There you go, you asked for it... Have fun

This discussion is preserved as it was. New answers, comments, and votes are closed.