Like if you got shot, it'll play a sound. Like "Braaa" or "OOOH." And it randomly selects a sound each time you are you are injured. Something like this.
local NewHealth = Humanoid.Health + (Humanoid.Health/Humanoid.MaxHealth) + 1 if NewHealth = Humanoid.Health and Humanoid.Health = -1 < then sound1:play() end
And another sound will play depending on how much damage you take. Like in older games (Preferably DOOM, Quake, and Serious Sam) where when you take damage, your guy will make a sound.
if NewHealth = Humanoid.Health and Humanoid.Health = - 1< -- you take greater than 1 damage, it'll ---play then sound1:play() end
To get when a player gets hurt we need to connect the humanoid Changed event and then check in the function if the property changed was Health. After we check if the property changed was the health we then check if the last health we got from the humanoid is below the current health after that we would play the sound.
The Lua conversion:
-- This goes at the top of the script. local lh = 0 local ply = game.Players.LocalPlayer -- This goes in the character event in the health script local humanoid = ply.Character.Humanoid lh = ply.Character.Humanoid.Health humanoid.Changed:connect(function(prop) if prop == "Health" then if lh > humanoid.Health then -- This checks if health is below the last health from the humanoid print("Play sound") end lh = ply.Character.Humanoid.Health end end)
I check if this works and it does, so if it doesn't you can ask me to help you more.