I've been trying to store an effect object in a table in function A and then bringing it back in function B. But when I'm trying to retrieve the object, it's actually an userdata with some weird number.

Is there any way to construct the object back with the userdata it gives back when I do for k,v in pairs(IdToEffect)?

Thanks!


Code:
-- Key is effect's id and value is the object
effectAddedHandler = function(send,args)
       ...
       effect = Turbine.Gameplay.LocalPlayer.GetInstance().GetEffects();
       IdToEffect[effect:Get(effect:GetCount()):GetID()] = effect:Get(effect:GetCount())
end

effectRemovedHandler = function(send,args)
       for k,v in pairs(IdToEffect) do
       ...
end