Actor -> BindableEvent Instance passing

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()
image
My results after the :Fire()
image

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?

1 Like

Found an answer here:

Non-string indices come to get me again. I’m gonna convert it to type {{Instance: Instance, Value: number}}

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.