Attempt to require a non-ModuleScript

So, i have been attempting to create a self-playing player. (It’s only an experiment)
I wrote NN module and the machine learning algorithm and then i got this error.
I don’t know why did that happen.

image
image
“attempt to require a non-ModuleScript”

Seems fairly self-explanatory you must be calling require on a script which isn’t of the ModuleScript class.

Id - 8064765621

Seems like it’s a module

The script needs to be named “MainModule” if you’re requiring from an asset ID.

Have you named the MainModule you want to require the module when publishing it?

image
I named it exactly like this

Are you correctly returning a value at the end?

image
Yes

Yeah as mentioned above it needs to be named “MainModule” when saving as a model to Roblox.

1 Like

works fine for me

are you requiring in a local script?

Yes, because i need to do that from local script.
Am i supposed to use loadstring?

You can’t require modules by an id from the client.

Either store it in ReplicatedStorage or get the server to require it and return it through a remote function.

You could just have a hard-copy of the ModuleScript in the place.

You still can’t use loadstring on the client.