How to store IDs in a ModuleScript

Hey, I wanted to ask how I can store userIDs and return them in a ModuleScript, I want to make a mod list with this.

local module = {}

local IDs = {}

module.addId = function(plr,id)
IDs[plr] = id
end

module.getId = function(plr)
return IDs[plr]
end

return module

1 Like

You just return a table similar to how you’d make a table in a variable containing all the mod UserIds,

Example ModuleScript code

return {
	526363673,
	3473473,
	1
}

Then when you require the ModuleScript, you’ll be immediately given the table to then use for your usecase, such as checking if a player who joined is a mod or not

can you answer me one question?
I did similar thing to yours,

local StaffList = {}

StaffList.Driver = {
82193741289, --player A
82193741123, --player B
82443435123, --player C
}

StaffList.Admin = {469809537,
	
}

return StaffList

It only returns player A if called in this way: local StaffList = require(game.ServerScriptService.StaffList).Driver

Why is that, and how should that be fixed?

hell, just realized that i made a rookie mistake in my script, sorry for bothering.