Unable to Communicate ReplicatedStorage to ServerScriptService

I am creating a NetworkOwnership Module for both the server and the client to use that is inside of replicated storage. The module needs to be able to communicate with the server to set the network owner.

Currently, I am unable to communicate between the two.

I’ve tried using bindable and remote events, nothing has worked so far.

Architecture:
image

Code for Driver (in ServerScriptService):

local RemoteEvent = game.ReplicatedStorage.Modules.Both.NetworkOwnership.RemoteEvent
local NetworkOwnershipDriver = {}

RemoteEvent.OnServerEvent:Connect(function(object, networkOwner)
	
	
	warn("fart")
	
end)

return NetworkOwnershipDriver

Code for Interface (in ReplicatedStorage)

local RemoteEvent = script.RemoteEvent

local NetworkOwnership = {}

NetworkOwnership.SetNetworkOwner = function(object, networkOwner)
	
	print("caught")
	RemoteEvent:FireServer(object, networkOwner)
	
end

return NetworkOwnership

First off, is the Module script inside of ServerScriptService being required? If not any code inside of it wont run, also something I’ve noticed is that when you have events under a module they sometimes dont run, so put them in a folder in RStorage, or just directly in RStorage.

If none of those work can I see the what I assume is the local script requiring the module thats in RStorage?

Fixed, I realized that since modules scripts need some sort of formally running script (since they are essentially just tables).

1 Like