How could I know if a player died and use it in an if statement. In my game, every time a player dies, a point will be given to the other team. Is there a way to do this? Thank you for trying to help.
You can use the .Died
RBXScriptSignal of Humanoid
to create an event upon the affiliated Player “dying”.
local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") Humanoid.Died:Connect(function() print(Player.Name.. " Died" end)