-- In a LocalScript in StarterGui:
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
-- Insert RGBlist number count on this line
-- Create ColorBox
local colorBox = Instance.new("Frame")
colorBox.Name = "Color"
colorBox.Parent = screenGui
colorBox.Position = UDim2.new(0, 0, 0.5, -75)
colorBox.Size = UDim2.new(0, 150, 0, 150)
colorBox.BackgroundColor3 = Color3.fromRGB(redValue,greenValue,blueValue)
local RGBlist = Instance.new("IntConstrainedValue",game.StarterGui)
RGBlist.Name = "RGB Possible Value List"
RGBlist.MaxValue = 255
RGBlist.MinValue = 0
RGBlist.Value = 0
-- Create RedValue
local redValue = 0
-- Create RedInput
local redInput = Instance.new("TextBox")
redInput.Name = "Red"
redInput.Parent = screenGui
redInput.Position = UDim2.new(0.5,-100,0.5,-75)
redInput.Size = UDim2.new(0,200,0,50)
redInput.BackgroundColor3 = Color3.new(255,0,0)
function redText()
if redInput.Text <=0 or redInput.Text == ("-" .. math.random()) or redInput.Text == math.random() then
redValue = 0
elseif redInput.Text == RGBlist.Value then
redValue = RGBlist.Value
end
end
redText()
I wanted to make sure that if someone typed a value between 0 and 255 into a text box, it would default to that number for a certain int value in the script. But, the way I typed it wouldn't work, and I have no idea of how to fix it.
