How to retrieve data from those type of modules?

Just found out today that connecting the table element command to a function is realisable. But it is possible to retrieve the data from it?

local Commands = {}

local RankingSystem = require(script.Parent.RankingSystem)

function Commands:GetCommands()
	local Commands = {}

	Commands["kill"] = function()
		local Command = {}
		Command["Description"] = "Kills a player"
		Command["PermissionLevel"] = "Undercover Special Agent"
	end

	Commands["host"] = function()
		local Command = {}
		Command["Description"] = "Host a shift"
		Command["PermissionLevel"] = "Intern Team"
	end
	
	Commands["ban"] = function()
		local Command = {}
		Command["Description"] = "Ban a player"
		Command["PermissionLevel"] = "Intern Team"
	end
	
	Commands["unban"] = function ()
		local Command = {}
		Command["Description"] = "Unban a player"
		Command["PermissionLevel"] = "Human Ressources Team"
	end
	
	Commands["infos"] = function()
		local Command = {}
		Command["Description"] = "Get the profile of a player"
		Command["PermissionLevel"] = "Management Team"
	end
	
	Commands["to"] = function()
		local Command = {}
		Command["Description"] = "Teleport to a player"
		Command["PermissionLevel"] = "Management Team"
	end
	
	Commands["tp"] = function()
		local Command = {}
		Command["Description"] = "Teleport a player to another player"
		Command["PermissionLevel"] = "Intern Team"
	end
	
	Commands["warn"] = function()
		local Command = {}
		Command["Description"] = "Warn a player for a reason [Abuse = demotion]"
		Command["PermissionLevel"] = "Supervision Team"
	end
	
	-- AI debug mode
	Commands["debugmode"] = function()
		local Command = {}
		Command["Description"] = "Toggle ai debugging mode"
		Command["PermissionLevel"] = "Developement Team"
	end
	
	-- Unclaim a stand from a player
	Commands["unclaimstand"] = function()
		local Command = {}
		Command["Description"] = "Unclaim the stand of one player [Abuse = demotion]"
		Command["PermissionLevel"] = "Management Team"
	end
	
	Commands["logs"] = function()
		local Command = {}
		Command["Description"] = "Get the server logs"
		Command["PermissionLevel"] = "Staff Team"
	end
	
	Commands["lockstand"] = function()
		local Command = {}
		Command["Description"] = "Lock the stand of one player [Abuse = demotion]"
		Command["PermissionLevel"] = "Intern Team"
	end
	
	Commands["viewstandids"] = function()
		local Command = {}
		Command["Description"] = "Reveal the gamepass ids of a player stand"
		Command["PermissionLevel"] = "Supervisor Team"
	end
	
	Commands["team"] = function()
		local Command = {}
		Command["Description"] = "Change your team"
		Command["PermissionLevel"] = "Undercover Special Agent"
	end
	
	Commands["kick"] = function()
		local Command = {}
		Command["Description"] = "Change your team"
		Command["PermissionLevel"] = "Undercover Special Agent"
	end
end

return Commands

Please never build tables like that;
If you want to referance table itself in a method please look at this documentation Functions | Documentation - Roblox Creator Hub

1 Like

what table i should go with for my command system then?

Neither;This is just stuipid.Also why do you put : if function is not a method?
Why do you create a table each time?That a complete death to perfomance.
Please read the document i provided Functions | Documentation - Roblox Creator Hub
I would not recomend you making anything “advanced” before locking in on learning Luau for a good year or so.