How Would I Go About Using TextBoxes For Color3 Values

Hey there! I’m trying to make a game where you have a part on your players mouse and I’m making a GUI where you can change the color of it through RGB. I was wondering if it is possible to change the color of it using TextBoxes text. Thanks!

local script of rgb value
text box

Your methods works however, it needs tweaking. Don’t define the text outside of the MouseButton1Down scope. It’ll get a different value.

local player = game:GetService("Players").LocalPlayer

script.Parent.change.MouseButton1Click:Connect(function()
    -- use the "tonumber" global function to turn all the text into numbers
    -- it'll return "nil" if the text couldn't be translated

    -- when you press the button, it'll get the newer values
    local r = tonumber(script.Parent.R.Text)
    local g = tonumber(script.Parent.G.Text)
    local b = tonumber(script.Parent.B.Text)

    -- rest of the code here
end)
3 Likes