Hi helpers, I'm trying to make a script so that, a part's brick color is dependent on a humanoid's health, eg if the humanoid's health is 100, the part's brick color is green, but if the health is 0, the brick color is red. The "Target" is a model with a torso, humanoid root part, a humanoid, a head, and other body parts. The script is located inside the humanoid root part. Here is the code.
local Target = script.Parent.Parent
local Torso = Target.Torso
local Hmd = Target.Humanoid.Health
while true do Torso.BrickColor = BrickColor.new(1 - (Hmd * 0.01), Hmd * 0.01, 0) wait(0.1) end
A response would be helpful. Thanks! -cooldeath49