So this is where i used the Hit variable in the script, this is where the blood pool will form and disappear
if Hit then
Drop.CanCollide = true
local Radious = math.random(math.random(1, 2))/1
local Blood_Ground = Resource:FindFirstChild("Blood"):Clone()
Blood_Ground.CFrame = (CFrame.new(RayPosition, RayPosition - Normal) * CFrame.Angles(math.rad(90), math.random(-360,360), 0)) * CFrame.new(0, 0/2,0)
Blood_Ground.CanCollide = false
Blood_Ground.Parent = workspace.Debris
Blood_Ground.splat:Play()
TweenService:Create(Blood_Ground, TweenInfo.new(math.random(3, 4), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Size = Vector3.new(Radious, 0, Radious)}):Play()
local transparency = TweenService:Create(Blood_Ground, TweenInfo.new(math.random(3, 3), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Transparency = 0.016})
transparency:Play()
Drop.Transparency = 1
Drop.Anchored = true
Drop.CanCollide = false
delay(5, function()
local Clean = TweenService:Create(Blood_Ground, TweenInfo.new(math.random(1, 1), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Transparency = .1})
Clean:Play()
Clean.Completed:Wait()
Blood_Ground:Destroy()
end)
break
end
So this is the part where the blood pool forms
Here is the Whole code for the Hit variable (which is a function)
function Blood:Create(Damage, Limb, Current_Health)
spawn(function()
local Force = Vector3.new(0, 0, 0)
local Set_Position = (Limb.CFrame * CFrame.new(0, 0.4, 0)).p
local Drop = Resource:WaitForChild("Drop"):Clone()
Drop.Parent = workspace.Debris
local X, Y, Z = math.random(30, 90)/15, math.random(100, 200)/15, math.random(30, 90)/15
local _X, _Z = math.random(-100, -1)/10, math.random(-100, -1)/10
Force = Vector3.new(math.random(_X, X), Y, math.random(_Z, Z))
Drop.Velocity = Force * 3
Drop.CFrame = Limb.Parent.Torso.CFrame-- * CFrame.new(math.random(-0, 0)/20, 0, math.random(-0, 0)/20)
Drop.CanCollide = true
spawn(function()
repeat wait()
-- Cast(Drop.Position, Vector3.new(10/100, 10/100, 10/100))
local Hit, RayPosition, Normal = Cast(Drop.Position, Drop.CFrame.lookVector*0.5)
if Hit then
Drop.CanCollide = true
local Radious = math.random(math.random(1, 2))/1
local Blood_Ground = Resource:FindFirstChild("Blood"):Clone()
Blood_Ground.CFrame = (CFrame.new(RayPosition, RayPosition - Normal) * CFrame.Angles(math.rad(90), math.random(-360,360), 0)) * CFrame.new(0, 0/2,0)
Blood_Ground.CanCollide = false
Blood_Ground.Parent = workspace.Debris
Blood_Ground.splat:Play()
TweenService:Create(Blood_Ground, TweenInfo.new(math.random(3, 4), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Size = Vector3.new(Radious, 0, Radious)}):Play()
local transparency = TweenService:Create(Blood_Ground, TweenInfo.new(math.random(3, 3), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Transparency = 0.016})
transparency:Play()
Drop.Transparency = 1
Drop.Anchored = true
Drop.CanCollide = false
delay(5, function()
local Clean = TweenService:Create(Blood_Ground, TweenInfo.new(math.random(1, 1), Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0), {Transparency = .1})
Clean:Play()
Clean.Completed:Wait()
Blood_Ground:Destroy()
end)
break
end
until Hit ~= nil or Drop:FindFirstChild("Delete")
Debris:AddItem(Drop, 3)
end)
end)
end
return Blood
(Yet again don’t know if this is helpful since this is the first time posting on the Devforum)