I have this health scripting colors, and when the health changes color, it will tween to white first, and then tween to the next color (yellow,red), the first tween works (green,white,yellow) but the second tween won't (yellow,white,red), it seems that any color won't tween to the red color, but when I try tweening the red color to other colors, it works. Is there any problem with it?
elseif health >= 21 and health <=40 then
healthcolor.ImageColor3 = Color3.new(255,255,0)--Yellow
textbox.Text = 2
elseif health >= 1 and health <=20 then
local tween = TweenService:Create(healthcolor, tweeninfo,
{ImageColor3 = Color3.fromRGB(255,255,255)}) --Yellow tween to white
tween:Play()
wait(0.5)--Script wait until tween stop
local tween = TweenService:Create(healthcolor, tweeninfo,
{ImageColor3 = Color3.fromRGB(255,0,0)})--White tween to red
tween:Play()
wait(0.5)--Script wait until tween stop
healthcolor.ImageColor3 = Color3.new(255,0,0)
textbox.Text = 1
while true do
textbox.TextColor3 = Color3.new(255,0,0)
wait(0.5)
textbox.TextColor3 = Color3.new(0,0,0)
wait(0.5)
end

1 comment
Nevermind, just found out that it works, but not all the time. I don't know why. I'm just gonna disable the tween