Bindable Functions Not Invoking

This has been confusing me for the past 30 minutes. I have a script (loader) where bunch of module scripts under it are being required and inserted into a table and then another script (requester) requests two different modules from that script via a bindable function. Not but an hour ago these bindable functions were working perfectly, but now the loader isn’t receiving the requesters invokes and infinitely yielding the requester. I’ve placed print statements at multiple points in the requester, and they print until directly before the invoke.

loader

local Services = {}

for i, item in pairs(script:GetChildren()) do
	if item:IsA("ModuleScript") then
		Services[item.Name] = require(item)
	end
end

function script.ReturnModule.OnInvoke(name)
print("hi") -- doesnt print
	return Services[name]
end

requester

local Players = game:GetService("Players")

local ServiceLoader = game:GetService("ServerScriptService").ServiceLoader:WaitForChild("ReturnModule")

print("hi") -- prints

local UIService = ServiceLoader:Invoke("UIService")
local EOUService = ServiceLoader:Invoke("EOUService")

print("hi") -- Doesnt print

What am I doing wrong here? Am I being dumb?

Try this:

function something(name)
print("hi")
    return Services[name]
end

script.ReturnModule.OnInvoke = something

nvm, i AM dumb, one of the modules was invoking the other from an experiment I was doing

1 Like