why isnt my script working? it doesnt give an error it just doesnt emit the blood
-- Import the BloodEngine module
local BloodEngine = require(game.ReplicatedStorage.Asset.Modules.WaitForChild("BloodEngine"))
local Humanoid = script.Parent:WaitForChild("Humanoid")
local OldHealth = Humanoid.Health
local LocalPlayer = game:GetService("Players").LocalPlayer
local torso = script.Parent:WaitForChild("Torso")
-- Initialize BloodEngine with desired settings
local Engine = BloodEngine.new({
FolderName = "Droplets", -- Specifies the name of the folder containing the droplets.
Type = "Decal", -- Defines the droplet type. It can be either "Default" (Sphere) or "Decal".
Limit = 500, -- Sets the maximum number of droplets that can be created.
Filter = {}, -- An array/table of instances that should be ignored during droplet collision.
DefaultSize = { 0.4, 0.7 }, -- Specifies the default size range of a pool.
DefaultTransparency = { 0.3, 0.4 }, -- Specifies the default transparency range of a pool.
StartingSize = Vector3.new(0.1, 0.3, 0.1), -- Sets the initial size of the droplets upon landing.
ScaleDown = true, -- Determines whether the pool should scale down when decaying.
DropletDelay = { 0.01, 0.03 }, -- Sets the delay between emitting droplets in a loop (for the EmitAmount method).
DropletVelocity = { 1, 2 }, -- Controls the velocity of the emitted droplet.
DropletVisible = true, -- Determines if the droplet is visible upon emission.
DropletColor = Color3.fromRGB(103, 0, 0), -- Determines the color of the emitted droplet.
RandomOffset = true, -- Determines whether a droplet should spawn at a random offset from a given position.
OffsetRange = { -5, 5 }, -- Specifies the offset range for the position vectors.
SplashName = "Impact", -- The name of the attachment that releases particles on surface contact.
SplashAmount = { 5, 10 }, -- Sets the number of particles to emit upon impact.
SplashByVelocity = true, -- If true, sets the number of particles based on the velocity of the droplet.
VelocityDivider = 8, -- Controls how much the velocity can affect the splash amount, Higher values reduce the effect.
Expansion = true, -- Determines whether a pool can expand when a droplet lands on it.
Distance = 0.2, -- Sets the distance (in studs) within which the droplet should check for nearby pools
ExpanseDivider = 3, -- Controls how much a pool's size can increase. Higher values reduce the increase.
MaximumSize = 0.7, -- Sets the maximum size a pool can reach.
Trail = true, -- Controls the visibility of the trail during droplet emission.
DecayDelay = { 10, 15 }, -- Sets the delay before the droplet decays and recycles
})
Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
if Humanoid.Health < OldHealth then
local count = 0
repeat task.wait(.1)
count += 1
local difference = math.abs(Humanoid.Health < OldHealth)
print(difference)
Engine:Emit(torso, torso.CFrame.Y * Vector3.new(math.random(-120,120),math.random(15,25),math.random(-120,120)), 120)
until count >= (0.5 * difference)
count = 0
end
OldHealth = Humanoid.Health
end)