Server script in a local runtime when using a plugin

I am trying to detect remote events being sent from the client, but since the plugin is running on the client, i can’t use .OnServerEvent, how can i get around this?

I don’t know how to get around this engine limitation, heres the code

local events = {}

local output = script.Parent.Parent.Server

local function addv(v)
	if v:IsA("RemoteEvent") then
		v.OnServerEvent:Connect(function(...)
			output:FireAllClients(v.Name, ...)
		end)
	end
end

for i,v in game:GetDescendants() do
	addv(v)
end

game.DescendantAdded:Connect(addv)

“output” variable is a RemoteEvent that sends info to a main script about what happened in a Event. but since its erroring when using .OnServerEvent, it can’t send anything to the output.

If your using RemoteEvents on a plugin, consider BindableEvents or a modular system instead.

Thats not the problem, whenever i put a Server script in my plugin, it can’t use .OnServerEvents with remote events outside the plugin. I have to put it in the same parent for the remote event to work.

But what i am making is a remote logger, which tracks what the Client sends and what it gets. But i can’t see what it sends. (For example: Buying a gun in a game, but i don’t know how to detect the remote event being fired without a server script, and a server script wont work in a plugin because its running in a client environment.