Abrah_m's Blood System V1 [Open-Sourced]

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:

particle

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. :slightly_smiling_face:

Un-Copylocked Game:

https://www.roblox.com/games/6930482253/Blood-System-Open-Source

26 Likes

Hmmm, maybe provide a visual of what’s happening? Couldn’t understand too well.

1 Like

I noticed, the effect is server-sided so that makes it appear where the character was in the past. It would be nice if you could make it appear correct relative to the client.

5 Likes

ok I know this post is old, but I saw it and wanted to help/use it, so I made some updates.

First: Now the blood drops create blood puddles.

Second: I’ve made it into a local script for optimization reasons and to reduce server load.

Well, this is the result: https://streamable.com/xcuy8z

And here is the Un-Copylocked with the new updates: Blood System Open Source Update - Roblox

3 Likes