So I want to make a Gui that chooses a Slider or a Box to change a value in a Table.
This is the Table
local Table = {
"A",
4,
"Dd",
346,
53,
"rtyr",
3e2,
"ten"
}
If a value is a number or a string in chooses box but if it is a number it also can choose a slider
but I dont know how to get it to choose box if stirng or number but randomly choose whether to use a box or a slider for a number can anyone help me?
This is what I got so far
local Ui = require(game:GetService("ReplicatedStorage").UiLibrary)
local Window = Ui:CreateWindow("Example")
local Table = {
"Box",
"Slider"
}
for I, V in pairs(game:GetChildren()) do
pcall(function()
local MathRandom = math.random(1, #Table)
if Table[MathRandom] == "Box" then
local Box = Window:Box(V.Name, {
flag = "Box",
type = "string"
}, function(box, new, old, enter)
print(box, new, old, enter)
V.Name = new
end)
elseif Table[MathRandom] == "Slider" then
local Slider = Window:Slider(V.Name, {
min = 0,
max = 10000000000,
flag = "Slider"
}, function(v)
V.Name = v
end)
end
end)
end
Please Help Me!