Essentially, I have two scripts, hereby named A and B. B is passing itself to A through a Bindables. Then A is sending a table back with B as a key to an index of value. But when I try to use B to find the value in the table by doing table[B], it is returning nil.
I have even tried just sending B but the B==B comparison is returning false.
Just tested passing Instances by themselves and after some adjustments it now works. However table with Instances as KEYS have the keys changed into some string.
If someone can figure out how to pass instance key tables that would be great as it can make my bindables more efficient
I think it has to do with how roblox sends the data over the events.
Script A:
--!strict
local event = script.Parent.Event
event.OnInvoke = function(inst : Instance)
return {
[inst] = 'Hello'
}
end
Script B:
--!strict
local event = script.Parent.Event
local result = event:Invoke(script)
local t = {
[script] = 'Bye'
}
print(result)
print(t[script]) --> bye
print(result[script]) --> nil
print(result[`<Instance> (ScriptB)`]) --> Hello
As you can see in script B, if you make the table inside of script B containing the referense key of the instance, it will print the value, but if the instance key was created in Script A and sent through a remote, it no longer registers the instance itself and is converted to string