local x=script:WaitForChild("\099\114\101\097\116\101\066\108\111\111\100")x.OnServerEvent:connect(function(x,e,P,S,j,s)local z=CF(P,P+S)*CFANG(RAD(-90),0,0)local r=Instance.new("\080\097\114\116")r.Transparency=1 r.Anchored=true r.CanCollide=false r.FormFactor="\067\117\115\116\111\109"r.Size=V3(.2,1,.2)r.TopSurface=0 r.BottomSurface=0 local n=Instance.new("\080\097\114\116\105\099\108\101\069\109\105\116\116\101\114")n.Color=ColorSequence.new(s.bloodSettings.Color)n.LightEmission=0 n.Size=NumberSequence.new(s.bloodSettings.Size)n.Texture=s.bloodSettings.Texture n.Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,s.bloodSettings.startTransparency);NumberSequenceKeypoint.new(1,1)})n.EmissionDirection=Enum.NormalId.Top n.Lifetime=NumberRange.new(s.bloodSettings.Lifetime-.05,s.bloodSettings.Lifetime+.05)n.Rate=s.bloodSettings.Rate n.Rotation=NumberRange.new(0,90)n.Speed=NumberRange.new(s.bloodSettings.Speed)n.VelocitySpread=s.bloodSettings.Spread n.Parent=r r.Parent=j r.CFrame=z if not e.Anchored then local x=Instance.new("\087\101\108\100",r)x.Part0=e x.Part1=r x.C0=e.CFrame:toObjectSpace(z)r.Anchored=false end delay(.15,function()n.Enabled=false wait(s.bloodSettings.Lifetime+.05)r:Destroy()end)end)
----------------------------------------------------------------------
--------------------[ BLOOD HANDLING ]--------------------------------
----------------------------------------------------------------------

local createBlood = script:WaitForChild("createBlood")
createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
	local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
	local Blood = Instance.new("Part")
	Blood.Transparency = 1
	Blood.Anchored = true
	Blood.CanCollide = false
	Blood.FormFactor = "Custom"
	Blood.Size = V3(0.2, 1, 0.2)
	Blood.TopSurface = 0
	Blood.BottomSurface = 0

	local Particles = Instance.new("ParticleEmitter")
	Particles.Color = ColorSequence.new(S.bloodSettings.Color)
	Particles.LightEmission = 0
	Particles.Size = NumberSequence.new(S.bloodSettings.Size)
	Particles.Texture = S.bloodSettings.Texture
	Particles.Transparency = NumberSequence.new({
		NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency),
		NumberSequenceKeypoint.new(1, 1),
	})
	Particles.EmissionDirection = Enum.NormalId.Top
	Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
	Particles.Rate = S.bloodSettings.Rate
	Particles.Rotation = NumberRange.new(0, 90)
	Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
	Particles.VelocitySpread = S.bloodSettings.Spread
	Particles.Parent = Blood

	Blood.Parent = gunIgnore
	Blood.CFrame = bloodCF
	if not H.Anchored then
		local Weld = Instance.new("Weld", Blood)
		Weld.Part0 = H
		Weld.Part1 = Blood
		Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
		Blood.Anchored = false
	end
	delay(0.15, function()
		Particles.Enabled = false
		wait(S.bloodSettings.Lifetime + 0.05)
		Blood:Destroy()
	end)
end)
