hello developers! im trying to create a system that changes the placement of the frames in the UIListLayout. here is an example:
if you would press the up button on the “stone miners” job, it would move to the top. if you pressed down on the “wood choppers” job, it would be at the bottom. if anybody knows how to make a system like this, could you please teach me how you did it? thank you!
maybe make a local script inside the arrow button that when a player clicks on the button the frame moves down or up
for example
script.Parent.Activated:Connect(function()
local Frame = -- enter your frame here
Frame.LayoutOrder == Frame.LayoutOrder - 1 -- if you are doing the down button, then replace "-" to "+"
end)
script.Parent.Activated:Connect(function()
local Frame = -- enter your frame here
local Layout = Frame.LayoutOrder
if Layout <= 0 then
-- do what you want if the Frame is at the top
elseif Layout >= 4 then -- if you have like 6 Jobs replace the 4 to 6, if you have 2 Jobs then replace it to 2
-- do what you want if the Frame is at the bottom
else
Layout = Layout - 1 -- if you are doing the down button, then replace "-" to "+"
end
Frame.LayoutOrder == Layout