Ok, so I want to show a red GUI that is transparent (.7) then show a message that says "Danger: Low Health" then I want the sound of a heart beating to go ONLY if the player as less than 25 health. But the sound will not turn off if the player has more Cany anyone help me?
textlabel = script.Parent warningdis = script.Parent.Parent player = game.Players.LocalPlayer humanoid = player.Character.Humanoid while wait() do textlabel:WaitForChild ("heartbeat") if humanoid.Health <=25 then heartbeat = Instance.new("Sound",textlabel) heartbeat.Name = heartbeat heartbeat.SoundId = "rbxassetId://131038747" heartbeat.Looped = true end if heartbeat.Health >25 then heartbeat:Destroy() end while true do if humanoid.Health <=25 then warningdis.Visible = true textlabel.Text = "Warning: Low Health!" end if humanoid.Health >25 then warningdis.Visible = false end wait() end end

1 comment
Please highlight all of your code and click on the blue Lua button so we can read what your script is.