Hey,
I am making an admin commands model called “True Admin”
and i made a “settings” module.
-
What do you want to achieve?
I want to get the index from this dictionary table
Module
--|RANKS|---
-- Manual ranks
-- YOU DO NOT HAVE TO PUT YOUR SELF ANYWHERE HERE!
setting.Ranks = {
['Owner'] = {'Beez_up'}; --1
['Moderator'] = {}; -- 2
['Head Admin'] = {}; -- 3
['Admin'] = {}; -- 4
['VIP'] = {}; -- On himself only -- 5
['NonAdmins'] = {} -- 6
}
- What is the issue?
Script
function getRanks(plr)
local a,g
for k,v in pairs(ranks) do
if table.find(v,plr.Name) then
a = k.index
break
end
end
for k,v in pairs(Group_Admins) do
if table.find(v,plr:GetRankInGroup(groupID)) then
g = k
break
end
end
return a,g
end
This function returns the rank of the player in the group
and the rank of that player in the module “Ranks” so i can know if the player can run the command
The issue is that in a = k.index
return nil also i dont want it to return the key because
i cant use if 'Owner' >=4 then
it will be simpler if it return a number.
Groups_Admins
works well.
Thanks for reading