Hi ! I’ve recently tried to make an efficent blood system I don’t know if I did it the best way and I want to make my game as good as possible !
If any more experienced Roblox Scripter could review my script than I would be the happies man ! THANKS !
Only thing i considered changing is to use Module script and OOP instead of simple server script !
local humanoid = script.Parent.Humanoid
local rayOrigin = script.Parent.Position
local rayDirection = (part.Position - script.Parent.Position).Unit * 30
local raycastResult = workspace:Raycast(rayOrigin, rayDirection)
if raycastResult then
if raycastResult.Instance.Anchored == true then
local part = Instance.new("Part", script.Parent)
part.Anchored = true
part.Size = Vector3.new(0,0,0)
part.Shape = "Cylinder"
part.BrickColor = BrickColor.new("Maroon")
part.Material = Enum.Material.Glass
part.Reflectance = .2
part.CanQuery = false
part.CanTouch = false
part.CanCollide = false
part.Orientation = raycastResult.Instance.Orientation --- Vector3.new(0,90,0)
part.Position = raycastResult.Position
local Sscript = script["siye Changer"]:Clone()
Sscript.Parent = part
Sscript.Enabled = true
for i, v in pairs(workspace:GetPartBoundsInRadius(Vector3.new(script.Parent.Position),100)) do
if v~= script.Parent then
The thing works by detecting the health change than getting all parts in a certain radius (adjustable) than calling a function called “check()”
and passing the part wich was detected than a quick raycast towards the parts position
if the ressult Instance is Anchored than a Cylined will spawn there !
Although this is probably not the “best” blood system, it is still a good one. You are not copying the material, so it will not be performance efficient. It is because you copy the script instead of the material.
Let’s say you want 100 blood decals. If you copy the script, you will have 100 scripts which is quite expensive.
If you copy the material, it is only once.