Intro
Hello DevForums, I’m abrah_m.
Basically, I made a blood system. It works by, whenever your HP goes down, blood will spill out. Now this system is not in anyway advanced. In fact, I made it around half an hour (mainly because of the blood particle). I may or may not update it if it gets attention.
For anyone that asks if this is compatible with R6 and R15, it is.
How To Use // How It Works
This system, you really don’t need to know how to use, as everything is automatic. You don’t need to fire an event or anything to activate the blood. Just simply take damage, and droplets will come out.
But you want to learn how to works? Well it’s simple:
You have the particle in server storage and the script in StarterCharacterScripts (which is inside of StarterPlayer).
Note: How the code works is explained inside of each of the script.
Script:
local Character = script.Parent -- Gets the character which is the scripts parent
local OldHealth = Character:WaitForChild("Humanoid").Health -- Gets the starting health
local Debris = game:GetService("Debris"); -- Gets debris service which will remove the blood in-case it still exists in the workspace
Character:WaitForChild("Humanoid"):GetPropertyChangedSignal("Health"):Connect(function() -- Function that runs when health is changed
local NewHealth = Character:WaitForChild("Humanoid").Health -- Records the new health after the health is changed
if NewHealth < OldHealth then -- Checks if the new health is lower than the old one
for partAdd = 1, math.random(6, 12) do -- Gets a random number from 6-12. If the number is for example 7, the code line below will run 7 times, making 7 particles
local Effect = game.ServerStorage.BloodPart:Clone() -- Clones the effect
Effect.Parent = workspace -- Parents the effect so it appears
Effect.CFrame = Character:WaitForChild("HumanoidRootPart").CFrame * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180))) -- Changes the position of the blood's starting point to the HumanoidRootPart and changes the direction of where it's looking at to a random angle
Effect.Splatter:Play() -- Makes blood sound will play
local EffectVelocity = Instance.new("BodyVelocity", Effect) -- Makes it so that the cloned effect will expand out
EffectVelocity.MaxForce = Vector3.new(1, 1, 1) * 1000000; -- Sets the max force of moving out
EffectVelocity.Velocity = Vector3.new(1, 1, 1) * Effect.CFrame.LookVector * math.random(20, 40) -- Sets the direction of where it's exerting to (which is where the effect is looking at), and changes the amount of force exerted from a random number from 20-40
Debris:AddItem(EffectVelocity, 0.2) -- Destroys the velocity so blood effect slowly comes down like a parabola
Debris:AddItem(Effect, 3) -- Destroys effect just in-case it still exists
end
end
OldHealth = NewHealth -- Sets the old health to the new health (which is the health that was changed)
end)
Usage
For my ragdoll script, I wanted credit, but I don’t really care if you give credit or not anymore.
Un-Copylocked Game:
https://www.roblox.com/games/6930482253/Blood-System-Open-Source