I want to require a ModuleScript that is parented to my current script, after I require I change the ModuleScripts Parent, and the Script’s Parent. However the variable I set that is equal to the required module gets overridden somehow.
I commented out my code so its barebones however it still doesn’t work. modulemystery.rbxl (16.6 KB)
You can easily just require the module from another place from the script inside workspace, as how you’re setting the variable setting then requiring it is probably messing with the requiring of the module. Try adding the module to ReplicatedStorage or ServerScriptService, then require it from a variable inside the script.
I agree with @desinied, as you are then later going to require it from ReplicatedStorage anyway (commented but I suppose you did that for testing) https://gyazo.com/479ddf66dc6b5aec55eef0ac31bfe93e you should just keep the script there from the start to avoid all this moving around you currently do.
Its meant to be a freemodel for people who aren’t script savvy, so whenever they place the model in the game the objects go into their correct place, so it’s why I’m doing it this way. So this isn’t really a solution for it.
I see your point. If you wish to then you can just use the following little kit I made to parent everything correctly. Just place the scripts in the folders and create new folders if you need to move something to another child of “game”.