My oh so great instance method can't create remotefunctions

my oh so great instance method has failed me. i call for a remotefunction, it tells me “OnServerInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available.”

i am in dire need of assistance.

(so basically i can’t call typeof(instance.OnServerInvoke) without it giving me an error and stopping the entire method. i figure a ... not instance:IsA'RemoteFunction'... would fix it but i don’t want to have to edit this method again in the event that i get the same error for trying to get the type of another property.)

--
if type(index) == 'string' then
	if index == 'Parent' then
		parent = value
	else
		--this is the part where it breaks my heart
		if typeof(instance[index]) == 'RBXScriptSignal' and type(value) == 'function' then
			--i cry every night
			instance[index]:connect(value)
		else
			instance[index] = value
		end
	end
end
--

(thanks in advance!)

You can’t index OnServerInvoke for RemoteFunction’s so if you want to get the typeof it then you will have to save the reference to the value before it is set in some way, or implement the fix you mentioned later.

I personally ran into this issue around a week ago while trying to wrap all of my RemoteFunctions and RemoteEvents during runtime so I could analyze a persisting issue that was breaking my game.

I doubt you will run into any more cases like this. There is a chance, but its very slim and you will probably quickly exhaust the ‘non indexable property’ list.

1 Like