this post is from 2 years ago but i saw that the solution isnt something that helped you with how to make the blood splat i guess, and .Touched() wouldnt work well, heres a code that i made. For the script to work, you MUST insert a folder named ‘Blood’ in workspace
---| Services
local TweenService = game:GetService('TweenService')
local Players = game:GetService('Players')
---| Constants
local tweenInfoIn = TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)
local tweenInfoOut = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local ignored = {workspace.Blood}
---| Functions
function Raycast(origin, direction)
local hit, rayPosition, normal = workspace:FindPartOnRayWithIgnoreList(Ray.new(origin, direction), ignored)
if hit then
local humanoid = hit.Parent:FindFirstChild('Humanoid') or hit.Parent.Parent:FindFirstChild('Humanoid')
if humanoid then
table.insert(ignored, humanoid.Parent)
return Raycast(origin, direction)
end
return hit, rayPosition, normal
end
end
function StartSplatHitbox(splatter)
task.spawn(function()
repeat wait()
local hit, rayPosition, normal = Raycast(splatter.Position, splatter.Velocity.Unit * 5)
if hit then
local humanoid = hit.Parent:FindFirstChild('Humanoid')
if not humanoid then
local unit = splatter.Velocity.Unit.X * 100
local size = Random.new():NextNumber(0.0035, 2)
splatter.Anchored = true
splatter.CFrame = CFrame.new(rayPosition, rayPosition - normal) * CFrame.Angles(math.rad(90), math.rad(unit), 0)
TweenService:Create(splatter, tweenInfoIn, {Size = Vector3.new(size, size/8, size)}):Play()
task.delay(15, function()
local tween = TweenService:Create(splatter, tweenInfoOut, {Transparency = 1})
tween:Play()
tween.Completed:Wait()
splatter:Destroy()
end)
end
end
until splatter.Anchored
end)
end
---| Main Program
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild('Humanoid')
local torso = character:WaitForChild('Torso')
humanoid.Died:Connect(function()
if character:FindFirstChild('Head') then
character.Head:Destroy()
for i = 1, math.random(200, 250) do
local velocityX = Random.new():NextNumber(-10, 10)
local velocityZ = Random.new():NextNumber(-10, 10)
local velocity = torso.CFrame.UpVector * Random.new():NextNumber(10, 50) + Vector3.new(velocityX, 0, velocityZ)
local bloodDrop = Instance.new('Part')
bloodDrop.CanCollide = false
bloodDrop.Color = Color3.fromRGB(128, 0, 0)
bloodDrop.Material = Enum.Material.Slate
bloodDrop.Size = Vector3.new(0.1, 0.5, 0.1)
bloodDrop.Parent = workspace.Blood
bloodDrop.CFrame = CFrame.new(torso.Position + torso.CFrame.UpVector * 0.5, Vector3.new(0, 90, 0))
bloodDrop.Velocity = velocity
bloodDrop.RotVelocity = velocity/2
StartSplatHitbox(bloodDrop)
task.wait()
end
end
end)
end)
end)