I’m trying to pass a dictionary of {[Instance]: number} via BindableEvents. I do this so I can Pool previously created Models of different types and place them where appropriate automatically.
The issue is that when I call Fire() with the dictionary, it gets converted to type {[string]: number}
My results prior to the :Fire()
My results after the :Fire()
Associated code:
--Inside any of 32 Actors
local function getObjects()
local result = findObjects()
task.synchronize()
print(next(result), typeof(next(result)))
Bindable:Fire(result)
end
-- Inside a LocalScript without an Actor ancestor
local function doBindable(result: {[BasePart]: number})
for instance, value in result do
print(instance)
print(typeof(instance))
print(instance.Name)
print(value)
print(typeof(value))
end
end
Bindable.Event:Connect(doBindable)
Anyone know what’s going on here or what I need to fix?