How do you "Activate" module scripts?

How is this one laid out in explorer? (CoreReplicator)
image

Its a child of the Localscript in MainModule > Assets > Locals > LocalScript

Yeah, but what are the different types of all of those things? (Can you please send a screenshot of Explorer)

Do you have a link to where you got the model from btw? There may be some information there that was missed.

Undefined Universe - Creator Store

OK, I could get it to do something if I move the LocalScript to PlayerGUI, then enabled it. I’m not sure what a bunch of the other stuff is for though

yeah, I did the same except I moved it to starterplayerscripts, I know that part but whats supposed to happen Is: whenever you type !start (number 1 to 10 I think) or do ctrl + x, something big is supposed to happen like a backgrounds basically

Looking at that MainModule thing, i’ve concluded that it just clones the Assets folder twice, and returns it to the calling script (as a function, for some reason, so you have to do () to get it)


I don’t see anything in the code that listens to chat at all. You said you saw in a video? Can you please link it?

Do you want a video or a screenshot that might help you understand what the script does?

Roblox Undefined Universe - YouTube

there is also other videos that use the !start in chat but the one I sent you uses g/uu

Would you like another video that uses !start?

@equsjd1 oi, this is your module right?

One of the (credited) creators of it was last online on the devforum one day ago, so I’ve @ him so he gets notified. We’ll see if he knows (I’d hope he would)

alright, hopefully that works.

To “activate” module scripts, you can use require() and put the module script position in the parameter.

Looks like you have a problem.

First, you should put a variable at the 1st line: local module = {}

Then put return module at the end of the script line

Actually, you should probably do this to every module script.



local clone = assets.Clone is not a way to get a variable of a clone. You already have the cloned variable which is local assets = script.Assets:Clone() which is probably why you get an error. According to the explorer, there is no such instance as “Clone”.


You cannot require a file. Only ModuleScripts.


If you want to “activate” a ModuleScript, so it works basically like a regular script, you need to wrap the entire inside (or specific segment of it) of the ModuleScript in function and while requiring you call on that function.

The code within the ModuleScript will then execute either server sided or client sided, based off the script that required it.

Like so:

--[[ ----------------------------------
	-- REMOTE SETUP --
---------------------------------- ]]–

local RemoteName = ScriptValues.RemoteName.Value
local Remote = Instance.new(“RemoteEvent”)
local RemoteCE = nil

local RemoteRequests = {}
local function OnClientEvent(RequestType, …)
    if RemoteRequests[RequestType] then
        RemoteRequestsRequestType
    end
end

– REMOTE CHECKER
return function() -- Here I return the function, code above is not needed to return as it only declares stuff, it does not execute any of it, though if you do return it nothing bad happens
    local RemoteCheck = heartbeat:Connect(function()
    for i, remote in services.ReplicatedStorage:GetChildren() do
        if remote:IsA(“RemoteEvent”) and remote.Name == RemoteName and remote ~= Remote then
	        -- New Remote
	        if RemoteCE then
	            RemoteCE:Disconnect()
	        end

	        Remote = remote
	        RemoteCE = Remote.OnClientEvent:Connect(OnClientEvent)
	    end
        end
    end)
end)

Server/Client sided script

require(MainModule.Assets.Assets.Locals.LocalScript.CoreReplicator.CSE)()

I might close this post bcs nothing’s working. neither of your solutions worked so I guess I’ll maybe give up for now

1 Like

You may have the wrong ideal of how a module works and the wrong ideal of how a remote works.
This looks like zero research. Programming is 80%+ research, here is a good start…

How To Use Module Scripts In Roblox Studio - Advanced Tutorial
How to Use Remote Functions In Roblox Studio - Advanced Tutorial

This guy is pretty good: AlvinBlox. Go over everything he has.

1 Like