I’m really bad at explaining things so bare with me.
So I am trying to get a color3 value to change with 3 text boxes. So far I have had no luck.
Video:
If it helps here is the code:
local colorBox1 = script.Parent.TextBox1
local colorBox2 = script.Parent.TextBox2
local colorBox3 = script.Parent.TextBox3
local previewPart = script.Parent.Parent.ChangeTo
-- Function to update the color preview
local function updatePreview()
local r = tonumber(colorBox1.Text) or 0
local g = tonumber(colorBox2.Text) or 0
local b = tonumber(colorBox3.Text) or 0
script.Parent.Change:Fire(r,g,b)
end
colorBox1.Changed:Connect(updatePreview)
colorBox2.Changed:Connect(updatePreview)
colorBox3.Changed:Connect(updatePreview)
The preview of the color and the value are supposed to update as you type the numbers in, but they aren’t.
local r = script.Parent.Parent.Parent.RBOX
local g = script.Parent.Parent.Parent.GBOX
local b = script.Parent.Parent.Parent.BBOX
local function tapOrClick()
local red = tonumber(r.Text)
local green = tonumber(g.Text)
local blue = tonumber(b.Text)
if red and green and blue then
print(red)
print(green)
print(blue)
game.Workspace.boatcontrol.outsideboatcolors.OutBoatLightC.Value = script.Parent.Parent.Parent.ChangeTo.Value
end
end
script.Parent.MouseButton1Click:Connect(tapOrClick)
script.Parent.TouchTap:Connect(tapOrClick)