Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i detect a players health?

Asked by 4 years ago
Edited 4 years ago

I have not played in a while and I forgot.

1 answer

Log in to vote
0
Answered by 4 years ago

I figured it out.

Local script:

local plr = game.Players.LocalPlayer
local h = plr.Character:WaitForChild("Humanoid")

h.Changed:connect(function(s)
if h.Health <= 0 then
    print("Dead Boi")
    end
end)

Ad

Answer this question