-- This script makes everytime a player dies, blood will come out --


function died()
	local human = script.Parent:FindFirstChild("Humanoid")
	if (human.Health == 0) then
		for i = 1,50 do
			local torso = script.Parent:FindFirstChild("Torso")
			if torso ~= nil then
				local blood = Instance.new("Part")
				blood.BrickColor = BrickColor.new("Crimson")
				blood.Transparency = 1
				blood.Size = Vector3.new(1, 0.4, 1)
				blood.Position = torso.Position
				blood.Name = "Blood"
				blood.Reflectance = 0.1
				blood.Material = "SmoothPlastic"
				blood.BottomSurface = "Smooth"
				blood.TopSurface = "Smooth"
				blood.Parent = game.Workspace
				local billboard = script.BillboardGui:clone()
				billboard.Parent = blood
				local gui = script.BloodGui:clone()
				gui.Parent = billboard
				game:GetService("Debris"):AddItem(blood, 12)
			end
		end
	end
end

script.Parent.Humanoid.Died:connect(died)
