Firing ModuleScript Becomes Nil

Server Side:

local module = require(workspace.MainModule)
game.ReplicatedStorage.requestEvent:FireClient(plr, module)

Client side:

game.ReplicatedStorage.requestEvent.OnClientEvent:Connect(function(request)
print(request)
end)

It prints nil, meaning that request is nil

What is your module returning?

MainModule is returning a function.

Then that makes sense. Functions can’t be sent across the network since they can’t be serialized.

Why can’t the client just require the module though?

2 Likes

Why can’t the client just require the module though?

I’m trying to make it through id and the client can’t do that

If the client needs the function, you might as well make it accessible to them.

2 Likes