Can't Require A Module Script

Hello! So I got a strange issue that makes certain module scripts not work in some other module scripts

When I try to require CombatModule in other ModuleScripts it doesn’t work:
DevForum1

But when I try to require it from a script or localscript everything works perfectly fine:

The Output(Can’t require, so it has this issue):

I tried to create new modules, recreating old ones and require CombatModule from them. I also tried to change names, Paths, but nothing worked.

I have a feeling that this is some Roblox Studio issue(a bug) that needs to be fixed.

Please help me fix that or comment if you share the same issue.

Can I see some of your module script? Maybe you incorrectly set something up, like having all functions local, instead of like, for example, function combat.functionname() instead of function functionname()

This Module works in other scripts:

The Module itself:

I just can’t require it in other modules for some reason.

Also after I made a post i noticed another interesting thing. My other Module(CheckModule) has the same issue with unability to require, but works fine unlike the CombatModule:
image

oh yeah, sorry, I misread what you wrote, I’ll try and look at it again and see if I can see any issues

use classic scripts to add scripts parameters inside of your module functions

maybee?

1 Like

So, local CombatModule = require(RP.Modules.Combat) is line 6 in CounterHandler, right? Just making sure.

Yes, I also made these 2 videos to make it more simple to understand

when my code looks like this:
image
https://gyazo.com/a6ec8f7cd336df782407f3da65ecb4ee

And when it looks like this:
image
https://gyazo.com/dcf35f18fe2ebc6af15bc79db1ab939c

You also can clearly see that others module are required above this line and they work fine, CombatModule and CheckModule share the same issue, they can’t be required.

Can you provide all the errors you getting?

It seems like there is a problem with your module script ( the video shows more than 1 error

These errors are happening because there are others scripts that require CombatModule(CombatModule works in them). But they can’t require it because CombatModule is getting required in the CounterHandler(and it doesn’t work). So CounterHandler breaks every other script, while trying to require CombatModule

I have an idea, does combat module ever try and required CounterHandler?

1 Like

No, But Combat Module requires CheckModule(CheckModule and CombatModule can’t be required from other module scripts, they share the same issue).

id imagine, somewhere, someway, however all this works, somewhere something ends up requiring itself or something when it requires one of the modules, if not that, I have no idea.

1 Like

Seems like you are requiring the module
( as in: module1 require module2… Them module2 require module1)
Required Recursively; the first error

My checkmodule is different from others. I use module:function method here. Maybe that’s the cause? And I noticed another thing, when I delete the require(CheckModule) from CombatModule, CombatModule can be required from other moduleScripts. So the problem is in the CheckModule. But what is it?

Maybe CheckModule required CombatModule or vise versa?

CTRL+F to seach in the script and find out

1 Like

I think I found the issue.

CombatModule requires CheckModule.

CheckModule requires CounterHandler.

CounterHandler requires CombatModule.

I gotta do something about this and recursive will be fixed.

so I was right about the problem, honestly surprised I caught that as the potential issue.

1 Like

should probably have the solution be the first mention of correct identification of what caused the issue