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