I'm trying to have a module script where I can call its methods on the client and the module script itself will fire to the server and call the same methods again with server permissions. Here's what I'm trying to do for .New method
function Orb.New(Player)
if IsClient then
return OrbFunction:InvokeServer("New")
else
local self = setmetatable({}, Orb)
--A bunch of defining variables and making parts here
return self
It successfully returns on both the client and server side, but then when I try to call methods on the returned object on the client side, it says I'm trying to call a nil value. Did I do the creation wrong, or could the problem be elsewhere?

2 comments
Is this code inside the module script itself, or is it another script trying to call it?
This is the code inside the module script