I have a very simple local script that fires a bindable event to another local script:
The issue is that any index that isn’t “command” or “id” is not received in the other script.
(To add on if I include a numerical index the “id” index is also not received)
I don’t have any if statements or anything like that which could be causing this to happen.
Here is one such example of this:
If you are using a BindableEvent, you should listen to it as
yourBindableEvent.Event:Connect(function(...)
-- Your stuff here.
end)
However, if you are using a BindableFunction, you should register a callback like the following
yourBindableFunction.OnInvoke = function(...)
-- Your stuff here.
end
Please, note how the BindableEvent class provides two methods: BindableEvent::Fire and BindableEvent::Connect, while the BindableFunction class provides a method and a callback, respectively: BindableFunction::Invoke and BindableFunction::OnInvoke.
I do believe that the behavior you are looking for should be one of these:
-- If a BindableEvent
GuiControl.Event:Connect(function(var)
if var.command == "close" then
elseif var.command == "insert" then
elseif var.command == "remove" then
delay(0, function() wait() print(var) end)
.
.
.
end)
-- If a BindableFunction
GuiControl.OnInvoke = function(var)
if var.command == "close" then
elseif var.command == "insert" then
elseif var.command == "remove" then
delay(0, function() wait() print(var) end)
.
.
.
end
Could you please elaborate on the “metatable data” part and state specifically what I am passing that qualifies as metatable data?
Because I am not using metatables whatsoever or even mentioned them at all.
If you look up at the original post, you’ll see I have two images. The top image being the value of the table printed before it is sent, and the value of the table after it is sent in the bottom table. Now, if you look real closely at the top image, you see a key named “quantity”. If you look to the right of the key you can see “2”, which is clearly not nil.
Not really sure what is going on then. Maybe you can testing in a different place or, even, make your own system to broadcast that type of information, which is what I would do if I was in a similar situation.