local Player = game.Players.LocalPlayer
local RepStorage = game:GetService("ReplicatedStorage")
local Remote = RepStorage:WaitForChild("DeathRemote")
local function FireRemote()
Remote:FireServer()
end
while true do
wait(1)
if game.Players.LocalPlayer.Character.Humanoid.Health <= 0 then
FireRemote()
end
end
-- how i wanted to fix it
Player.Character.Humanoid.Health.Changed:Connect(function()
print("Health Changed!")
end)
So this runs a loop every second to check if a player has died this can cause lag , I already have experienced lag currently im doing some lag work for my game can someone help me?

3 comments
I'm late, but Humanoid.HealthChanged is real.
Well, HealthChanged is a native function of Humanoid, but not belongs to the Health variable of the humanoid class.
I like Changed more, although it has a sightly higher firing frequency than the HealthChanged signal.