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

How would i Play a sound when you get a kill?

Im trying to make a game that plays a sound everytime you Kill somewone How Would i do this?

1 answer

✓ Accepted answer
game:GetService('Players').PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
local s = Instance.new("Sound", player)
s.SoundId = "" --Sound ID here
s.Volume = 0.5 --Sound Volume, 0 to 1
s.Pitch = 1 --Sound Pitch
s:play()
wait(5)
s:remove()
		end)
	end)
end)

1 comment

0

Please do not simply post code, explain the reason behind your answer, for if you don't, it does not help the user to understand the reason behind your answer, please add some kind of explanation.

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