Edit To Ranking and ExpLib

This commit is contained in:
Cooldude2606
2018-01-02 00:59:15 +00:00
parent 6d4473bec5
commit 4144054e2d
2 changed files with 23 additions and 3 deletions

View File

@@ -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

View File

@@ -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