Vague Recurring Error: Need New Perspective(s)

Hey Developers!

I have been having this vague recurring error for quite a few days and have thrown in the towel and now I am here.

Here are the deeds:

Error: 10:58:07.402 - Requested module experienced an error while loading

That link (within the Output) brings me to my reference of the module (ObjectCloning)

Reference to ObjectCloning:

local ObjectCloning = require(game.ServerStorage.ObjectCloning)
ObjectCloning.CreateVideoZoneDetectionObjectsClone()
ObjectCloning.CreateAssignedZoneClone()
ObjectCloning.CreateIntersectionBoundsClone()

Inside ObjectCloning:
local ObjectCloning = {}

local VideoDetectionObjects = game.ServerStorage.VideoDetectionObjects
local UnassignedZone = game.ServerStorage.VideoDetectionObjects.VideoZones.Vz_Unassigned
local ZoneIDNumber = game.ServerStorage.VideoDetectionObjects.VideoZones.Vz_Unassigned.Zone.ZoneIDNumber.Value
local IntersectionBounds = game.ServerStorage.VideoDetectionObjects.VideoZones.Utilities.IntersectionBounds
local Preemption = game.ServerStorage.VideoDetectionObjects.VideoZones.Utilities.PreemptionZone
local COUNT = game.ServerStorage.VideoDetectionObjects.VideoZones.Utilities.Vz_COUNT

UnassignedZone.Parent = game.ServerStorage
IntersectionBounds.Parent = game.ServerStorage

function ObjectCloning.CreateVideoZoneDetectionObjectsClone()
local VideoZoneClone = VideoDetectionObjects:Clone()
VideoZoneClone.Parent = game.Workspace
end
ObjectCloning.CreateVideoZoneDetectionObjectsClone()
function ObjectCloning.CreateAssignedZoneClone()
local AssignedZoneClone = UnassignedZone:Clone(“Vz”…ZoneIDNumber)
AssignedZoneClone.Parent = game.Workspace.VideoDetectionObjects.VideoZones
end
ObjectCloning.CreateAssignedZoneClone()
function ObjectCloning.CreateIntersectionBoundsClone()
local IntersectionClone = IntersectionBounds:Clone()
IntersectionClone.Parent = game.Workspace.VideoDetectionObjects.VideoZones.Utilities
IntersectionClone.Name = “ItWorks! Ave”
end
ObjectCloning.CreateIntersectionBoundsClone()

return ObjectCloning

Now, the very frustrating thing about this is that it was running and being referenced and loaded properly about two days ago…

Try moving it all into a regular script and seeing it where it errors. Please post any errors you find here.

1 Like

So, after commenting out the module reference and transferring the lua of ObjectCloning to a script, it doesn’t error, but nothing renders.

EDIT: After fixing some other scripts it works through a script, but I was hoping to use a module script for its simplicity and the fact that I would need my VideoZoneSystem to require ObjectCloning to even function.

Maybe I am not understanding the mechanics behind module scripts? They seem simple enough.

If what I’m seeing above is correct, you appear to be using Module scripts correctly. However, can you show the part of your main script where the require() function is? As well as that, try moving the edited version back into a module script and try re-require()-ing it.

The requested module experienced an error while loading happens when the module errors before it returns a value.
Usually there should be a stack trace below this error, showing which line inside the module errored. It might not appear in scenarios such as your module having a syntax error.

2 Likes

So, I called several functions within the ObjectCloning module while referencing it

ObjectCloning.CreateVideoZoneDetectionObjectsClone()
ObjectCloning.CreateAssignedZoneClone()
ObjectCloning.CreateIntersectionBoundsClone()

– removed the references and it works. I am one who likes to know how something failed, but I have yet to find out. I did watch some tutorials, but those showed that you would have to call the function within script that is referencing the module for it to run, but currently I have it as such:
local ObjectCloning = require(game.ServerScriptService.VideoZoneSystem.ObjectCloning)

I did find that calling the above functions while also referencing the module resulted in my desired objects cloning not just to the workspace as intended, but when there they duplicated again, so removing the called functions fixed that.

1 Like

Thank you for this insight! I’ll keep it in mind.