while true do if game.Players.LocalPlayer.Character.Humanoid:TakeDamage() then script.Parent.Parent.Sounds.Hurt:Play() end end
The TakeDamage method is used to well, take damage. You would put a number as a parameter and the Humanoid would take damage. You need to use the Changed event.
game.Players.PlayerAdded:connect(function(p) repeat wait() until p.Character -- You could also use the CharacterAdded event. I for some reason did it this way hum = p.Character.Humanoid old = hum.Health hum.Changed:connect(function() if (hum.Health < old) then script.Parent.Parent.Sounds.Hurt:Play() old = hum.Health end end) end)
The above script was actually tested and should work perfectly.
Locked by BlueTaslem
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?