Blood spawns when body part disapears

Hello, I made a script that when the player has a specified amount of hp he will lose a body part but I am trying to make an effect of blood dripping but I dont know how to spawn the effect or even make it in the place of missing body part.

Here is my script if you need it :

local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Hum = Char:WaitForChild("Humanoid")

local LeftArm = Char["Left Arm"]
local LeftLeg = Char["Left Leg"]

local LeftArmFell = false
local LeftLegFell = false

reset = false

while true do 
	repeat 
		wait(0.01)
		if Hum.Health <= 70 and LeftArmFell == false then
			LeftArmFell = true
			LeftArm:Destroy()
		end
		if Hum.Health <= 40 and LeftLegFell == false then
			LeftLegFell = true
			LeftLeg:Destroy()
		end
	until reset == true
end

Hey, I don’t know much about scripting. But I noticed something that ticks me off about your code.

Why is 2 seperate variables the same name?

1 Like

One is arm one is leg
It isnt the same one

I mean these

Summary

This text will be hidden

One is for when the LeftArm fell off so if its already destroyed the script doesnt check again if leftarm fell off

1 Like

To find the position of I assume the joints (in R6), where the blood needs to be, we can get HumanoidRootPart, and using the motor6d values in the Torso part, you can get an offset position, which you can then place a part, weld it to the Torso, then add a ParticleEmitter or use the part’s cframe to place blood parts, etc.

Cant i just make a particle emitter in the postion of the joint before it destroys?

so firstly you need to make a blood part that is unanchored, customize it. if its more than 1 part union it then name it for example “bloodpart” like i do here then put your part in ReplicatedStorage, also put this is StarterCharacter then StarterCharacterScripts for this version to work

local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Hum = Char:WaitForChild("Humanoid")

local LeftArm = Char["Left Arm"]
local LeftLeg = Char["Left Leg"]

local LeftArmFell = false
local LeftLegFell = false

reset = false

while true do 
	repeat 
		wait(0.01)
		if Hum.Health <= 70 and LeftArmFell == false then  
			LeftArmFell = true
			LeftArm:Destroy()
local Blood = game.ReplicatedStorage.bloodpart:Clone()  --clones the part from replicatedstorage
Blood.Parent = script.Parent.Parent --sets its parent to something in workspace so its visible
Blood.Position = script.Parent.Parent["Left Arm"].Position --sets the bloods position to the wanted body part
		end
		if Hum.Health <= 40 and LeftLegFell == false then
			LeftLegFell = true
			LeftLeg:Destroy()
local Blood = game.ReplicatedStorage.bloodpart:Clone()  --clones the part from replicatedstorage
Blood.Parent = script.Parent.Parent --sets its parent to something in workspace so its visible
Blood.Position = script.Parent.Parent["Left Leg"].Position --sets position like in the other line
		end
	--we dont need anything here since when the player finally dies the blood disappears if you dont want this to happen just change the blood parts parent to workspace
end  

hope this helps :slight_smile:

If you want blood spewing from the joints, you need this method since in R6, the welds are under the torso part, so relative to the torso part, not the limbs.

Hey thanks for the answer it had some issues but works thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.