The following error occurs when running require() on the asset id 563619835 and it only occurs in some servers, so it is not reproducible every time. I recently started to hear complaints from developers that utilize this asset in their games that it wasn’t working, so I can only assume it started recently.
In my testing, I have been unable to reproduce this bug myself, but it occurred in someone else’s game in one specific server and none of the other servers were affected.
Hello, to load Models into your game you don’t use Require. Require is now only used to load ModuleScripts that may contain Folders or GUIs etc. To load the Model you’ll need to do this:
local assetId = IdHere
local InsertService = game:GetService("InsertService")
local success, model = pcall(InsertService.LoadAsset, InsertService, assetId)
if success and model then
print("Model loaded successfully")
local ModelFolder = Instance.new("Folder")
ModelFolder.Parent = game.Workspace
ModelFolder.Name = "ModelFolder"
model.Parent = game.Workspace.ModelFolder --To control the Model I load it to Specified Folder that I created first.
else
print("Model failed to load!")
end
In my example, Model will be loaded to Folder called ‘ModelFolder’ located in Workspace. Model’s name will be ‘Model’. That’s why I created a Folder- you will be able to control it (rename, move to other location and other things).
I didn’t say that they can’t be used. You can upload ModuleScript to website as a Model named ‘MainModule’ but it can’t contain Scripts for example. To load a Model with Scripts you have to use InsertService.
I think this result caches, because when I rapidly disabled and enabled the script, it immediately caused this error, so even if I pcalled it and retried - it would error regardless.
If you still need help, there are places that do read the Module script. If you do require() in a script in ServerScriptService, it will read the module script.
I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved?
i’m currently making a paid gun system. it requires modules from my inventory, so people cant take my code. it works fine in my games, but not in group games. i don’t want to put my module on sale, because people could take my code. i don’t know how to solve this issue.
Edit: I just had to use httpservice and loadstring() to load in my code from pastebin, the code that loads in the pastebin code is obfuscated so people dont get the link. There are probably better ways of doing it but thats what I did, not working on the thing anymore but yeah