diff --git a/ExpCore/ranking.lua b/ExpCore/ranking.lua index c7dfe9ee..808b7fff 100644 --- a/ExpCore/ranking.lua +++ b/ExpCore/ranking.lua @@ -49,16 +49,16 @@ function Ranking.get_rank(mixed) local _return = false if is_type(mixed,'table') then if mixed.index then - _return = game.players[mixed.index] and ranks[mixed.permission_group.name] or false + _return = game.players[mixed.index] and ranks[mixed.permission_group.name] or nil else - _return = mixed.group and mixed or false + _return = mixed.group and mixed or nil end else _return = game.players[mixed] and ranks[game.players[mixed].permission_group.name] or table.autokey(ranks,mixed) and table.autokey(ranks,mixed) or string.contains(mixed,'server') and Ranking.get_rank(Ranking._presets().meta.root) or string.contains(mixed,'root') and Ranking.get_rank(Ranking._presets().meta.root) - or false + or nil end return _return end diff --git a/ExpLib.lua b/ExpLib.lua index b152ac46..9a502247 100644 --- a/ExpLib.lua +++ b/ExpLib.lua @@ -139,4 +139,24 @@ function ExpLib.tick_to_display_format(tick) end end +function ExpLib.Gui_tree(root) + local tree = {} + for _,child in pairs(root.children) do + if #child.children > 0 then + if child.name then + tree[child.name] = ExpLib.Gui_tree(child) + else + table.insert(tree,ExpLib.Gui_tree(child)) + end + else + if child.name then + tree[child.name] = child.type + else + table.insert(tree,child.type) + end + end + end + return tree +end + return ExpLib \ No newline at end of file