Player doesn't get revived and automatically bleeds out faster

I have a revive and carrying system however when you carry a player and then die the player that you were carrying gets uncarried however when a player revives you - the person that was carrying the person before doesn’t get revived and automatically bleeds out faster and this persists if you revive them again.

I have found no solutions so far.

	maid[player.Name.."HealthChanged"] = humanoid:GetPropertyChangedSignal("Health"):Connect(function()
		if humanoid.Health > previousHealth then previousHealth = humanoid.Health return end
		previousHealth = humanoid.Health
		
		if IsDowned.Value == false then
			local HealthLostHighlight = Instance.new("Highlight")
			HealthLostHighlight.Name = "HealthLostHighlight"
			HealthLostHighlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
			HealthLostHighlight.FillColor = Color3.new(1, 1, 1)
			HealthLostHighlight.OutlineColor = Color3.new(1, 1, 1)
			HealthLostHighlight.FillTransparency = 0.5
			HealthLostHighlight.OutlineTransparency = 0
			HealthLostHighlight.Parent = character

			local percent = Health.Value / humanoid.MaxHealth

			local OutlineColorTween = TweenService:Create(HealthLostHighlight, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {OutlineColor = RED:Lerp(GREEN, percent)})
			OutlineColorTween:Play()

			local FillColorTween = TweenService:Create(HealthLostHighlight, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {FillColor = RED:Lerp(GREEN, percent)})
			FillColorTween:Play()

			FillColorTween.Completed:Once(function()
				local OutlineTransparencyTween = TweenService:Create(HealthLostHighlight, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {OutlineTransparency = 1})
				OutlineTransparencyTween:Play()

				local FillTransparencyTween = TweenService:Create(HealthLostHighlight, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {FillTransparency = 1})
				FillTransparencyTween:Play()

				FillTransparencyTween.Completed:Once(function()
					HealthLostHighlight:Destroy()
				end)
			end)
		end
		
		local HealthLoss = (humanoid.MaxHealth - humanoid.Health)
		
		if HealthLoss > 0 then
			humanoid.Health += HealthLoss
			Health.Value -= HealthLoss
		end
		
		if Health.Value <= 0 then
			Health.Value = 0
		end
		
		if Health.Value <= 0 and IsDowned.Value == false then
			Health.Value = 0
			IsDowned.Value = true
			
			warn("how the hell")
			
			if Carrying.Value ~= "" then
				local FindCarriedPlayer = workspace:FindFirstChild(Carrying.Value)

				if FindCarriedPlayer then
					warn(FindCarriedPlayer.Name)
					local FindCarriedPlayerHumanoid : Humanoid = FindCarriedPlayer:WaitForChild("Humanoid")
					local FindCarriedPlayerHRP = FindCarriedPlayer:WaitForChild("HumanoidRootPart")

					local CarryPosition = FindCarriedPlayerHRP:FindFirstChild("CarryPosition")

					if CarryPosition then
						CarryPosition:Destroy()
					end

					local AlignOrientation = FindCarriedPlayerHRP:FindFirstChild("Align_PlayerOrientation")

					if AlignOrientation then
						AlignOrientation:Destroy()
					end

					local CarryAttachment0 = humanoidRootPart:FindFirstChild("CarryAttachment0")

					if CarryAttachment0 then
						CarryAttachment0:Destroy()
					end

					enableCollisions(FindCarriedPlayer)
					
					FindCarriedPlayerHumanoid.PlatformStand = true
					
					Carrying.Value = ""
					
					
				end
			end
			
			local RevivePrompt = Instance.new("ProximityPrompt")
			RevivePrompt.Exclusivity = Enum.ProximityPromptExclusivity.AlwaysShow
			RevivePrompt.Name = "RevivePrompt"
			RevivePrompt.Style = Enum.ProximityPromptStyle.Custom
			RevivePrompt.HoldDuration = 0.5
			RevivePrompt.RequiresLineOfSight = false
			RevivePrompt.ActionText = "Revive "..player.Name
			RevivePrompt.ObjectText = "Administer CPR"
			RevivePrompt.Parent = character
			
			local CarryPrompt = Instance.new("ProximityPrompt")
			RevivePrompt.Exclusivity = Enum.ProximityPromptExclusivity.AlwaysShow
			CarryPrompt.Name = "CarryPrompt"
			CarryPrompt.UIOffset = Vector2.new(0, 40)
			CarryPrompt.Style = Enum.ProximityPromptStyle.Custom
			CarryPrompt.KeyboardKeyCode = Enum.KeyCode.Q
			CarryPrompt.HoldDuration = 1
			CarryPrompt.RequiresLineOfSight = false
			CarryPrompt.ActionText = "Carry "..player.Name
			CarryPrompt.Parent = character
			
			local CheckIfBloodAmountExists = humanoidRootPart:FindFirstChild("BloodAmount")
			
			if CheckIfBloodAmountExists then
				CheckIfBloodAmountExists:Destroy()
			end
			
			local BloodAmountClone = BloodAmount:Clone()
			BloodAmountClone.Adornee = humanoidRootPart
			BloodAmountClone.Parent = humanoidRootPart
			
			CarryEvent:FireClient(player, BloodAmountClone, false)
			
			maid[player.Name.."RevivePrompt"] = RevivePrompt.Triggered:Connect(function()
				Blood.Value += AMOUNT_OF_BLOOD_TO_REGEN
				
				if Blood.Value >= 300 then
					IsRagdoll.Value = false
					IsDowned.Value = false
					
					humanoid.PlatformStand = false
					
					maid[player.Name.."RevivePrompt"] = nil
					
					RevivePrompt:Destroy()
					CarryPrompt:Destroy()
					
					Threads[player.Name.."BloodLossThread"] = nil
					
					Blood.Value = 300
					Health.Value = 50
					
					local DownedHighlight : Highlight = character:FindFirstChild("DownedHighlight")
					
					if DownedHighlight then
						DownedHighlight:Destroy()
					end
					
					coroutine.wrap(function()
						task.wait(RESPAWN_TIME / 2)
						
						for _, v in pairs(BloodAmountClone:GetDescendants()) do
							if v:IsA("Frame") then
								TweenService:Create(v, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {BackgroundTransparency = 1}):Play()
							elseif v:IsA("TextLabel") then
								TweenService:Create(v, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {TextTransparency = 1}):Play()
							end
						end
						
						task.wait(0.5)
						
						BloodAmountClone:Destroy()
					end)()
				end
			end)

I have solved this by making it, so the humanoid doesn’t automatically set its state to ‘Dead’ when it actually dies by resetting so you can never theoretically die.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.