Creating Remotes

The title says it all. I am not sure what could be going wrong with this code:

Module Loader:

function Encyclopedia:AddRemotes(Service)
	local RemoteModule = require(Service.RemoteModule)
	
	for Name, Parent in ipairs(RemoteModule["Replicated"]) do 
		local Remote = Instance.new("RemoteEvent")
		Remote.Name = Name
		Remote.Parent = Parent
	end
end

Remote Module:

local ReplicatedStorage = game:GetService("ReplicatedStorage").ReplicatedStorage.Modules.Components

local RemoteTable = {
	Replicated = {
		["UpdateServer"] = ReplicatedStorage.DoorHandler.Remotes,
		["EquipMorph"] = ReplicatedStorage.MorphHandler.Remotes
	}
}

return RemoteTable

ipairs works only on tables whose indexes are numerical and have no skips. Try using pairs instead.

1 Like