Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Do MainModules get destroyed on a server?

Asked by 8 years ago

I was wondering if anyone can tell me if MainModule's get destroyed on a Server, cause I don't have any :Destroy(), .Parent = nil or anything like that in my script's that destroy them, they work perfectly fine in Studio but in a normal Server, I get error's like Module is not a valid member of ScreenGui.

1 answer

Log in to vote
1
Answered by 8 years ago

ModuleScripts required through their IDs (the ones you have to name "MainModule") are parented to a model whose parent is nil. If you don't want them to be a descendant of nil, you'll have to manually change the module's parent from within the module, or include the module in your game instead of requiring it from the site. They behave the same in studio as they do online, so I don't know what you mean by ScreenGui.Module working in Studio. Since you say its name is Module instead of MainModule though, I assume you're probably referring to actual ModuleScript instances you manually put in the game instead of ones you require from the site. ModuleScripts saved with your game can be interacted with because they have a parent -- modules required by ID are standalone and can't be interacted with by outside scripts unless you intentionally parent it to workspace or something.

Ad

Answer this question