Basically i wanna change the layoutorder of each button inside “Scroll”
I put intvalues to each button i wanna change its value,
I put simple in one,
Mild in one,
Difficult in one,
I tried this script but its not working
-- Create a table to store the LayoutOrder of the buttons
local dave = script.Parent.Parent
local scroll = dave.Eggdog.Easy.Davez
local function Baby()
for i, child in ipairs(scroll:GetChildren()) do
if child:IsA("ImageButton") then
for j, intValue in ipairs(child:GetChildren()) do
if intValue:IsA("IntValue") then
if intValue.Value == "Simple" then
child.LayoutOrder = 1
elseif intValue.Value == "Mild" then
child.LayoutOrder = 2
elseif intValue.Value == "Difficult" then
child.LayoutOrder = 3
end
end
end
end
end
end
local function Baby2()
for i, child in ipairs(scroll:GetChildren()) do
if child:IsA("ImageButton") then
for j, intValue in ipairs(child:GetChildren()) do
if intValue:IsA("IntValue") then
if intValue.Value == "Simple" then
child.LayoutOrder = 12
elseif intValue.Value == "Mild" then
child.LayoutOrder = 11
elseif intValue.Value == "Difficult" then
child.LayoutOrder = 10
end
end
end
end
end
end
script.Parent["Difficulty(Ascending)"].MouseButton1Click:Connect(function()
Baby()
end)
script.Parent["Difficulty(Descending)"].MouseButton1Click:Connect(function()
Baby2()
end)