local g=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\118\101\114\109\111\114\101"))local C=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Q=game:GetService("\082\117\110\083\101\114\118\105\099\101")local D=g("\082\101\115\111\117\114\099\101\067\111\110\115\116\097\110\116\115")if Q:IsServer()then return function(g)assert(type(g)=="\115\116\114\105\110\103")local Q=C:FindFirstChild(D.REMOTE_FUNCTION_STORAGE_NAME)if not Q then Q=Instance.new("\070\111\108\100\101\114")Q.Name=D.REMOTE_FUNCTION_STORAGE_NAME Q.Parent=C end local q=Q:FindFirstChild(g)if q then return q end q=Instance.new("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")q.Name=g q.Parent=Q return q end else return function(g)assert(type(g)=="\115\116\114\105\110\103")return(C:WaitForChild(D.REMOTE_FUNCTION_STORAGE_NAME)):WaitForChild(g)end end
--- Provides getting remote events
-- @function GetRemoteFunction

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local ResourceConstants = require("ResourceConstants")

if RunService:IsServer() then
	return function(name)
		assert(type(name) == "string")

		local storage = ReplicatedStorage:FindFirstChild(ResourceConstants.REMOTE_FUNCTION_STORAGE_NAME)
		if not storage then
			storage = Instance.new("Folder")
			storage.Name = ResourceConstants.REMOTE_FUNCTION_STORAGE_NAME
			storage.Parent = ReplicatedStorage
		end

		local func = storage:FindFirstChild(name)
		if func then
			return func
		end

		func = Instance.new("RemoteFunction")
		func.Name = name
		func.Parent = storage

		return func
	end
else -- RunService:IsClient()
	return function(name)
		assert(type(name) == "string")

		return ReplicatedStorage:WaitForChild(ResourceConstants.REMOTE_FUNCTION_STORAGE_NAME):WaitForChild(name)
	end
end