replica:ListenToArraySet<V>(path: Path, listener: (index: number, new_value: V) -> ()): () -> ()

Server & Client

Fires when ArraySet overwrites a value at a specific index of the array at path.

Parameters

path*
Path
Path to the array to observe.
listener*
ArraySetListener<V>
Called with the index and the new value at that index.

Returns

() -> ()Disconnect function.
replica:ListenToArraySet({"Inventory"}, function(index, itemId)
    print("Slot", index, "replaced with", itemId)
end)