Requiring a module stops the script all of a sudden

Hello everyone,

I have a script that handles player data and it works. However , all of a sudden the script breaks at require() with no errors or anything. It is something like this:

local Players = game:GetService("Players")
print(0)
local SSS = game:GetService("ServerScriptService")
print(1)
local PlayerDataModule = require(SSS.ModuleScripts.PlayerDataModule)
print(2)

the print(2) doesn’t run, meaning that the require is stopping the script for some reason did I do something wrong?.

Thank you,

Well, you probably need to check that module you’re requiring as there might be something that runs upon requiring the module (e.g. a loop) which is yielding your script.

2 Likes

Can you show us the whole module please?

the module doesn’t use any loop or yield at all, I didn’t change anything about it and it was working before.

If so, try to restart the studio as there might be an issue with it.

1 Like

it seems that I required the module inside itself which caused this, thanks for the help tho

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.