Hello ScriptingHelpers community, I've tried to use SetCustomSortFunction (a function which is within UIGridLayout) for the first time, but it's not working. Usually, the function will have one parameter, which will be the function. There should be two parameters, being the previous and next gui object which it'll sort. However, it provides no parameters. Am I using this incorrectly or is it simply broken? Here's my code.

SetCustomSortFunction(print)

(outputs nothing except for this error which is most likely because print returns nothing http://i.imgur.com/MSiBZLj.png), or even

SetCustomSortFunction(function(x,y) return tonumber(x.Name)>tonumber(y.Name) end)

(outputs nothing, which it shouldn't, but the error persists). and of course using this function after to apply the layout

ApplyLayout()

Does anyone know why this wont work?

Thanks for any help.

3 comments

0

Yes, it is

0

Try this note, not sure if this is your problem... "Your sort function may be called with the same object as both arguments or two objects which you wish to consider equal. In this case, it should return false."