You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to add the index the same as the varible in a table -
What is the issue? Include screenshots / videos if possible!
The issue is it is not adding the varible This is what it says:
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked in the Developer Hub, I reseted Studio, and I printed words to see if it words but It doesn’t for some reason.
Please Help
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local FrameTable = {}
local ScrollingTable = {}
local TextLabelTable = {}
local TextButtonTable = {}
local TextBoxTable = {}
local ImageButtonTable = {}
local ImageLabelTable = {}
local VideoFrame = {}
for i,v in pairs(Add:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
local object = Instance.new(v.Name)
if object then
if object:IsA("TextButton") then
object.Size = UDim2.new(0.146, 0,0.065, 0)
elseif object:IsA("TextBox") then
object.Size = UDim2.new(0.146, 0,0.065, 0)
elseif object:IsA("TextLabel") then
object.Size = UDim2.new(0.146, 0,0.065, 0)
elseif object:IsA("ImageButton") then
object.Size = UDim2.new(0.073, 0,0.13, 0)
elseif object:IsA("ImageLabel") then
object.Size = UDim2.new(0.073, 0,0.13, 0)
elseif object:IsA("Frame") then
object.Size = UDim2.new(0.073, 0,0.13, 0)
elseif object:IsA("ScrollingFrame") then
object.Size = UDim2.new(0.073, 0,0.13, 0)
elseif object:IsA("VideoFrame") then
object.Size = UDim2.new(0.073, 0,0.13, 0)
end
object.Parent = Main
object.Visible = true
object.Position = UDim2.new(.5,0,.5,0)
object.BackgroundColor3 = Color3.new(1,0,0)
end
end)
end
end
local SizeFrame = Properties.SizeFrame
local sizexframe = SizeFrame.X
local sizeyframe = SizeFrame.Y
local sizeXoffset = sizexframe.Offset
local sizeXscale = sizexframe.Scale
local sizeYoffset = sizeyframe.Offset
local sizeYscale = sizeyframe.Scale
Main.ChildAdded:Connect(function(object)
print(object.ClassName)
if object:IsA("TextButton") then
print("Adding Button To Table")
print(TextButtonTable)
for _,v in pairs(TextButtonTable) do
print("Adding Button To Table 2")
table.insert(TextButtonTable,_)
end
elseif object:IsA("TextBox") then
elseif object:IsA("TextLabel") then
elseif object:IsA("ImageButton") then
elseif object:IsA("ImageLabel") then
elseif object:IsA("Frame") then
elseif object:IsA("ScrollingFrame") then
elseif object:IsA("VideoFrame") then
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.