✓ Accepted answer
Very simply, by utilizing the ROBLOX-provided LuaSignals.
I'm assuming here that your AddSlot function returns a Table:
local CreateSignal = LoadLibrary('RbxUtility').CreateSignal
function AddSlot(slot)
local newSlot = {}
newSlot.ItemAdded = CreateSignal()
newSlot.ItemRemoved = CreateSignal()
end
Now, on its own, this does nothing, and I can't write the code to make it do something without seeing the rest of the AddSlot function.
What you need to do is call the fire method on those two LuaSignals, passing in the item that was added/removed, wherever you handle adding/removing items from Slots.
1 comment
Thank you so much, for your help.