KashTheKingYT

LowHealthEffect

Jun 11th, 2021
16,957
-1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 1
  1. local player = game.Players.LocalPlayer
  2. local character = script.Parent
  3. local humanoid = character:FindFirstChild("Humanoid")
  4. local sound = player.PlayerGui:FindFirstChild("LowHealthSound")
  5.  
  6. while wait() do
  7.     if humanoid.Health <= 40 then
  8.         if sound.Playing == false then
  9.             sound:Play()
  10.         end
  11.     else
  12.         if sound.Playing == true then
  13.             sound:Stop()
  14.         end
  15.     end
  16. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment