I'm using a morph gui which takes the names of the morphs in a folder and displays them on the gui. I want to reorder the models so that the morphs appear in a certain order (lowest rank to highest rank). Is this possible?
COMMUNITY QUESTION
How do I change the order of the labels?
1 answer
You could have an IntValue that has the rank of the morph. Then use whatever method you want to display them in order of highest to lowest value or lowest to highest. It just depends on what you want to do. You can use Operators(check the Relational section of the wiki post) to check which Value is lower and which is higher. Hope this helped. Have a great day scripting!
Edit 1.
One method of ordering them lowest to highest would be something like this:
local morphRanksTable = {}
for j = 1, #morphs:GetChildren()
for i,v in pairs(morphs:GetChildren()) do -- this is an example name
if v:FindFirstChild("Rank") then
if v.Rank.Value == j then
morphRanksTable[v.Rank.Value] = v.Name -- or j inside the brackets
end
end
end
end
then just loop through the morphRanksTable. morphRanksTable[1] should be the lowest ranked morph and so on. This is just an example. Hope this helps even more!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Of course its possible.. welcome to programming!!
if I helped you out please accept my answer. Otherwise comment how I can help you better