For unknown reason my code ingoners other colors.
For example i change Red color and it starts to ingores Blue and Green.
Like if i change first Blue to max then Green to max then it gonna be fully green with 0 of blue.
Like it doesn’t ingore just color which just was changed.
I tried to make print and to change every color in game menu, and after i changed Red to max then Blue to max and then Green to max it prints that Color3Value = 3.63713e-15, 1, 6.03086e-08
I use Local Script in StarterGui.
Here is my script:
local CarColorValue = script.Parent:WaitForChild("CarColor")
local RedTextBox = script.Parent:WaitForChild("Red")
local BlueTextBox = script.Parent:WaitForChild("Blue")
local GreenTextBox = script.Parent:WaitForChild("Green")
local function RedChanged()
if tonumber(RedTextBox.Text) ~= nil then
local NeededColor = Color3.fromRGB(math.clamp(RedTextBox.Text,0,255),CarColorValue.Value.G,CarColorValue.Value.B)
CarColorValue.Value = NeededColor
end
end
local function BlueChanged()
if tonumber(BlueTextBox.Text) ~= nil then
local NeededColor = Color3.fromRGB(CarColorValue.Value.R,CarColorValue.Value.G,math.clamp(BlueTextBox.Text,0,255))
CarColorValue.Value = NeededColor
end
end
local function GreenChanged()
if tonumber(GreenTextBox.Text) ~= nil then
local NeededColor = Color3.fromRGB(CarColorValue.Value.R,math.clamp(GreenTextBox.Text,0,255),CarColorValue.Value.B)
CarColorValue.Value = NeededColor
end
end
RedTextBox:GetPropertyChangedSignal("Text"):Connect(RedChanged)
BlueTextBox:GetPropertyChangedSignal("Text"):Connect(BlueChanged)
GreenTextBox:GetPropertyChangedSignal("Text"):Connect(GreenChanged)