Hello, recently I have been trying to make a permission system for admin commands. The player taking the model must enter their / others usernames into a table. I am still trying to figure out how I would convert the Usernames in the table to UserIds. I do not know if that is needed but it seems safer.
The table:
Ranks = {
{5, "Owner", };
{4, "HeadAdmin", {"Davide_24", "Another Name"}, };
{3, "Admin", {"Name Here", "Another Name"}, };
{2, "Moderator", {"Name Here", "Another Name"}, };
{1, "VIP", {"Name Here", "Another Name"}, };
{0, "None", };
}
local Module = require(game.ServerScriptService.AdminCommands)
Module:Initialize(Ranks)
I have tried using this (errors with nil value):
local Module = require(script.Parent)
wait(0.5)
local Headadmins = Module.adminList[2][3]
local Admins = Module.adminList[3][3]
local Moderators = Module.adminList[4][3]
local VIPs = Module.adminList[5][3]
local HeadAdminIDs = {}
local AdminIDs = {}
local ModIDs = {}
local VIPIDs = {}
for i = 1, #Headadmins do
local HeadAdmins2 = pcall(Headadmins[i]:GetUserIdFromNameAsync())
HeadAdminIDs.insert(HeadAdmins2)
print(HeadAdminIDs)
end
I hope someone can help me with this as I had this problem for a long time now. This is my first time using tables.
The module only relais the information the Server script.