Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with blood decals appearing on the player when damaged?

Asked by 2 years ago
Edited 2 years ago

I'm trying to make a script that will cause blood decals to appear on the player at various health intervals. however, the blood decals wont appear ontop of any clothing on the character. Here's a part of my script that creates one of the decals.

humanoid.HealthChanged:Connect(function()
if humanoid.Health  <= 80 then 
    Instance.new("Decal", bodyparts.RightLowerArm)
        bodyparts.RightLowerArm.Decal.Texture = "rbxassetid://247766283"
        bodyparts.RightLowerArm.Decal.Face = Enum.NormalId.Back
        bodyparts.RightLowerArm.Decal.Transparency = 0
    end
end)

1 answer

Log in to vote
0
Answered by
VAnkata20 135
2 years ago
Edited 2 years ago

For me everything is working correctly. The script I used for testing is

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character.Humanoid
        humanoid.HealthChanged:Connect(function()
            if humanoid.Health  <= 80 then 
                local BloodDecal = Instance.new("Decal", character.RightLowerArm)
                BloodDecal.Texture = "http://www.roblox.com/asset/?id=247766282"
                BloodDecal.Face = Enum.NormalId.Back
                BloodDecal.Transparency = 0
            end
        end)
    end)
end)

also the script is in ServerScriptService.

Ad

Answer this question