Im trying to make a game that plays a sound everytime you Kill somewone How Would i do this?
✓ ANSWER ACCEPTED
How would i Play a sound when you get a kill?
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
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.