Getting a module with an ID

Hi! I want to get my module (it returns a table, if that helps) into my place so I can make changes to it without having to copy and paste it each time, the main issue I’m running into is that

require(id)

can only run on the server. I tried to make a function to parent it so the client can use it too, but I was apparently my function didn’t exist?

Right now I’m stuck, I don’t know what to do, any answers are appreciated

EDIT: so for anyone whos stumbling on this to find a solution, I found out you can use InsertService:LoadAsset(id). Am I dumb? yes.
2nd edit: you cant use InsertService for modules. bruhhhhh

1 Like

Just do this.

local module = require(id)

Make sure the module name is called, “MainModule” as it will not work otherwise, and that should fix your issue. ^^ :slight_smile:

The issue is that this line of code

local mainModule = require(id)

can only be used on the server. I’m trying to do it on the client. I mean, the original problem is that I want to be able to just publish the module and get it from anywhere. It’s for balancing guns / armor.

why can’t you just put the module in ReplicatedStorage?

Because I want to not have to update the module for every place I have

well unless there is another way
you are going to have to require on the server

then if you really need to you can use remotes

I found a solution. I converted the module to a Package and then turned on AutoUpdate

1 Like