I have this portion of my script:
if health <= 30 then script.Parent.BackgroundColor3 = Color3.new(255,0,0) script.Parent.Shadow.BackgroundColor3 = Color3.new(223,0,0) end
It changes the color of the Script.Parent
wich is a bar, but when trying to change the color of the script.Parent.Shadow
it just changes the color to (0,25623,0)
.
Both are frames and were copy pasted
Why is this happening?
Can someone help me?
Thanks!
ROBLOX has an odd system, instead of the typical 255 system, they have it set up so that it needs to be in a range of 0 - 1 instead of 0 - 255 with the default constructor Color3.new().
Color3.new(number r, number g, number b) Color3.fromRGB(int r, int g, int b)
For Color3.new, it needs to be a number from 0 - 1, or you get odd results, however you can use Color3.fromRGB() which will get you the results you want.