i.e if Player health == 0 then print('ded') end
You can do this with the Humanoid.Died event.
i.e
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() print(player.Name .. " has died!") end) end) end)
Hey RealRexTeam,
local plrs = game:GetService("Players"); -- The players service plrs.PlayerAdded:Connect(function(plr) -- PlayerAdded anonymous function with parameter of the player. plr.CharacterAdded:Connect(function(char) -- CharacterAdded anonymous function with parameter of the player. local hum = char:WaitForChild("Humanoid"); -- The humanoid in the Character. hum.Died:Connect(function() -- .Died anonymous function print("Humanoid has died.") -- Prints "Humanoid has died." end) -- end for .Died function. end) -- end for .CharacterAdded function. end) -- end for .PlayerAdded function
~~ KingLoneCat