local J=getSetting("\080\111\111\108 \115\105\122\101 \109\117\108\116\105\112\108\105\101\114")or 1 playerService.PlayerAdded:Connect(function(s)if not workspace:FindFirstChild("\066\108\111\111\100")then folder=Instance.new("\070\111\108\100\101\114",workspace)folder.Name="\066\108\111\111\100"end local q=Instance.new("\070\111\108\100\101\114",folder)q.Name=s.Name s.CharacterAdded:Connect(function(d)local Y=d:WaitForChild("\072\117\109\097\110\111\105\100")Y.Died:Connect(function()pcall(function()local Y=d:FindFirstChild("\084\111\114\115\111")or d:FindFirstChild("\085\112\112\101\114\084\111\114\115\111")or nil local V=d:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")or nil local g local function w(s,d)local V=Instance.new("\080\097\114\116",q)V.CanCollide=false V.BrickColor=BrickColor.new("\067\114\105\109\115\111\110")V.Material=Enum.Material.Glass V.Transparency=.2 V.CastShadow=false V.Shape="\067\121\108\105\110\100\101\114"V.Anchored=true V.Size=Vector3.new(.1,0,0)V.CFrame=s.CFrame if d then V.CFrame=CFrame.new(Y.Position.X+math.random(-4,4),(g.Position.Y-g.Size.Y/2)+math.random(0,.2),Y.Position.Z+math.random(-4,4))else V.CFrame=CFrame.new(Y.Position.X+math.random(-4,4),g.Position.Y+g.Size.Y/2,Y.Position.Z+math.random(-4,4))end V.Orientation=Vector3.new(0,0,90);(tweenService:Create(V,TweenInfo.new(math.random(.4,4),Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{Size=Vector3.new(.1,math.random(3,7)*J,math.random(3,7)*J)})):Play()debris:AddItem(V,9)end if d.Humanoid.RigType==Enum.HumanoidRigType.R6 then wait(.2)if not d:FindFirstChild("\072\101\097\100")and workspace:FindFirstChild(s.Name.."-\050")then d=workspace[s.Name.."-\050"]end end repeat wait()until math.floor(Y.Velocity.Magnitude)==0 local n=d:GetChildren()pcall(function()for J,s in pairs((game:GetService("\080\108\097\121\101\114\115")):GetPlayers())do if s.Character then for J,s in pairs(s.Character:GetChildren())do if s:IsA("\066\097\115\101\080\097\114\116")then table.insert(n,s)elseif s:IsA("\065\099\099\111\117\116\114\101\109\101\110\116")then table.insert(n,s:FindFirstChildWhichIsA("\066\097\115\101\080\097\114\116"))elseif s:IsA("\084\111\111\108")and s:FindFirstChild("\072\097\110\100\108\101")then table.insert(n,s.Handle)end end end if workspace:FindFirstChild(s.Name.."-\050")then for J,s in pairs(workspace[s.Name.."-\050"]:GetChildren())do if s:IsA("\066\097\115\101\080\097\114\116")then table.insert(n,s)elseif s:IsA("\065\099\099\111\117\116\114\101\109\101\110\116")then table.insert(n,s:FindFirstChildWhichIsA("\066\097\115\101\080\097\114\116"))end end end end end)if type(n)=="\116\097\098\108\101"then local J=false g=(workspace:FindPartsInRegion3WithIgnoreList(Region3.new(Y.Position-Y.Size*2,Y.Position+Y.Size*2),n,1))[1]if not g then if d:FindFirstChild("\076\101\102\116 \076\101\103")then g=d["\076\101\102\116 \076\101\103"]J=true elseif d:FindFirstChild("\076\101\102\116\070\111\111\116")then g=d.LeftFoot J=true end end if g then for s,q in pairs(d:GetChildren())do if q:IsA("\066\097\115\101\080\097\114\116")and q.Name~="\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"then w(q,J)end end end end end)end)end)end)playerService.PlayerRemoving:Connect(function(J)if folder:FindFirstChild(J.Name)then folder[J.Name]:Destroy()end end)
-- Variables
local poolSizeMultiplier = getSetting("Pool size multiplier") or 1

playerService.PlayerAdded:Connect(function(plr)
	if not workspace:FindFirstChild("Blood") then
		folder = Instance.new("Folder", workspace)
		folder.Name = "Blood"
	end

	local charFolder = Instance.new("Folder", folder)
	charFolder.Name = plr.Name

	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")

		humanoid.Died:Connect(function()
			pcall(function()
				local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or nil
				local root = char:FindFirstChild("HumanoidRootPart") or nil
				local base

				local function bloodPool(part, limbCenter)
					local pool = Instance.new("Part", charFolder)
					pool.CanCollide = false
					pool.BrickColor = BrickColor.new("Crimson")
					pool.Material = Enum.Material.Glass
					pool.Transparency = 0.2
					pool.CastShadow = false
					pool.Shape = "Cylinder"
					pool.Anchored = true

					pool.Size = Vector3.new(0.1, 0, 0)
					pool.CFrame = part.CFrame

					if limbCenter then
						pool.CFrame = CFrame.new(
							torso.Position.X + math.random(-4, 4),
							base.Position.Y - (base.Size.Y / 2) + math.random(0, 0.2),
							torso.Position.Z + math.random(-4, 4)
						)
					else
						pool.CFrame = CFrame.new(
							torso.Position.X + math.random(-4, 4),
							base.Position.Y + (base.Size.Y / 2),
							torso.Position.Z + math.random(-4, 4)
						)
					end

					pool.Orientation = Vector3.new(0, 0, 90)
					tweenService
						:Create(
							pool,
							TweenInfo.new(math.random(0.4, 4), Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
							{
								Size = Vector3.new(
									0.1,
									math.random(3, 7) * poolSizeMultiplier,
									math.random(3, 7) * poolSizeMultiplier
								),
							}
						)
						:Play()

					debris:AddItem(pool, 9)
				end

				if char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
					wait(0.2)
					if not char:FindFirstChild("Head") and workspace:FindFirstChild(plr.Name .. "-2") then
						char = workspace[plr.Name .. "-2"]
					end
				end

				repeat
					wait()
				until math.floor(torso.Velocity.Magnitude) == 0
				local baseBlacklist = char:GetChildren()

				pcall(function()
					for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
						if plr.Character then
							for _, v in pairs(plr.Character:GetChildren()) do
								if v:IsA("BasePart") then
									table.insert(baseBlacklist, v)
								elseif v:IsA("Accoutrement") then
									table.insert(baseBlacklist, v:FindFirstChildWhichIsA("BasePart"))
								elseif v:IsA("Tool") and v:FindFirstChild("Handle") then
									table.insert(baseBlacklist, v.Handle)
								end
							end
						end
						if workspace:FindFirstChild(plr.Name .. "-2") then
							for _, p in pairs(workspace[plr.Name .. "-2"]:GetChildren()) do
								if p:IsA("BasePart") then
									table.insert(baseBlacklist, p)
								elseif p:IsA("Accoutrement") then
									table.insert(baseBlacklist, p:FindFirstChildWhichIsA("BasePart"))
								end
							end
						end
					end
				end)

				if type(baseBlacklist) == "table" then
					local limbCenter = false
					base = workspace:FindPartsInRegion3WithIgnoreList(
						Region3.new(torso.Position - torso.Size * 2, torso.Position + torso.Size * 2),
						baseBlacklist,
						1
					)[1]

					if not base then
						if char:FindFirstChild("Left Leg") then
							base = char["Left Leg"]
							limbCenter = true
						elseif char:FindFirstChild("LeftFoot") then
							base = char["LeftFoot"]
							limbCenter = true
						end
					end

					if base then
						for _, limb in pairs(char:GetChildren()) do
							if limb:IsA("BasePart") and limb.Name ~= "HumanoidRootPart" then
								bloodPool(limb, limbCenter)
							end
						end
					end
				end
			end)
		end)
	end)
end)

playerService.PlayerRemoving:Connect(function(plr)
	if folder:FindFirstChild(plr.Name) then
		folder[plr.Name]:Destroy()
	end
end)
