Hello, I am trying to write a test for something, and I’ve ran into a major problem that is holding me back currently.
When passing a userdata
created using the newproxy
function into a BindableEvent or BindableFunction, it is nil. Does anyone know any work-arounds for this? If so, please let me know. Here is my testing code to reproduce this:
local Event = Instance.new("BindableEvent",script)
Event.Name = "TestEvent"
local Callback = Instance.new("BindableFunction",script)
Callback.Name = "TestCallback"
Event.Event:Connect(function(Data)
if Data == nil then
warn("Data is nil!",Data,typeof(Data))
else
print(Data,typeof(Data))
end
end)
print("Event Test")
Event:Fire({Hello="World"}) --Not nil
Event:Fire(newproxy(true)) --Nil
Callback.OnInvoke = function(Data)
if Data == nil then
warn("Data is nil!",Data,typeof(Data))
else
print(Data,typeof(Data))
end
end
print("Callback Test")
Callback:Invoke({Hello="World"}) --Not nil
Callback:Invoke(newproxy(true)) --Nil
Output: