replica:ListenToArrayInsert<V>(path: Path, listener: (new_index: number, new_value: V) -> ()): () -> ()
Server & ClientFires when ArrayInsert appends a value to the array at path.
Parameters
path*Path | Path to the array to observe. |
listener*ArrayInsertListener<V> | Called with the new index and the inserted value. |
Returns
() -> ()Disconnect function.
replica:ListenToArrayInsert({"Inventory"}, function(index, itemId)
print("New item at slot", index, ":", itemId)
end)