local G=game:GetService("\082\117\110\083\101\114\118\105\099\101")local r={}function r.CreateSignal(r,G)assert(G=="\069\118\101\110\116"or G=="\070\117\110\099\116\105\111\110","\073\110\118\097\108\105\100 \116\121\112\101 \102\111\114 \115\105\103\110\097\108\046")return string.format("\083\105\103\110\097\108\058\037\115",G)end return r
local RunService = game:GetService("RunService")

local Networking = {}

function Networking:CreateSignal(type)
  assert(type == "Event" or type == "Function", "Invalid type for signal.")
  return string.format("Signal:%s", type)
end

--[[
local RemoteFunction = {}
RemoteFunction.__index = RemoteFunction

function Networking:HandleRemoteFunction(event)
  local self = setmetatable({}, RemoteFunction)
  self.Event = event
  return self
end

function RemoteFunction:Fire(...)
  if RunService:IsServer() then
    return self.Event:InvokeClient(...)
  else
    return self.Event:InvokeServer(...)
  end
end

function RemoteFunction:Connect(...)
  if RunService:IsServer() then
    self.Event.OnServerInvoke = ...
  else
    self.Event.OnClientInvoke = ...
  end
end

local RemoteEvent = {}
RemoteEvent.__index = RemoteEvent

function Networking:HandleRemoteEvent(event)
  local self = setmetatable({}, RemoteEvent)
  self.Event = event
  return self
end

function RemoteEvent:FireAllClients(...)
  assert(RunService:IsServer(), "This method can only be called on the server.")
  self.Event:FireAllClients(...)
end

function RemoteEvent:FireToGroup(group, ...)
  assert(RunService:IsServer(), "This method can only be called on the server.")
  for _, player in group do
    self:Fire(player, ...)
  end
end

function RemoteEvent:Fire(...)
  if RunService:IsServer() then
    self.Event:FireClient(...)
  else
    self.Event:FireServer(...)
  end
end

function RemoteEvent:Connect(...)
  if RunService:IsServer() then
    return self.Event.OnServerEvent:Connect(...)
  else
    return self.Event.OnClientEvent:Connect(...)
  end
end
]]

return Networking