Hello!
Some time ago I made a Rock Placer plugin, but yesterday I decided to rewrite it, redo the UI, and add new functions like choosing the color of the stone. The idea is to have three TextBox and each one represents an RGB value, one is R, one is G and so on.

Solution while using RGB in BrickColor
Just making it clear that I solved it, the important thing is problem 2.
I was trying to use RGB in BrickColor:
Rock.BrickColor = BrickColor.new (255, 255, 255)
It didn’t generate the desired color, so I went here to search DevForum and found something about BrickColor.new(Color3). So I tried:
Rock.BrickColor = BrickColor.new (Color3.fromRGB(255, 255, 255))
And it didn’t work either. But I tried another solution, looking at the properties of BaseParts, I realized that besides BrickColor they have Color:
Rock.Color = Color3.fromRGB(255, 255, 255)
It worked. I just don’t know if it’s good practice to use it, so I ask for help here.
Using the first solution I made half of the script work, but I couldn’t make it work with the tonumber() function inside a Color3:
local R = ColorR.TextBox.Text
local G = ColorG.TextBox.Text
local B = ColorB.TextBox.Text
if not R == "" or not G == "" or not B == "" then --> Verify if the TextBox text isn't nil
Object.Color = Color3.fromRGB(tonumber(R), tonumber(G), tonumber(B)) --> Where the problem goes!
else
Object.Color = Color3.fromRGB(99, 95, 98) --> It works
end
This does not give me any errors, but also does not work, I do not know if I misused the tonumber() or something, I have nothing to talk about. But when I write some number in the TextBox it gives me a black color. But the else of the script works and generates the desired color.
Also, do you know any method of preventing people from writing letters in a TextBox? and allow only Numbers?
Thank you for reading this!
This is my first topic in this category, I’m not a dedicated programmer either.