In short, I needed to create an array in which the rig models were used as a key, and task.spawn as a value. But the main point was that this array was constantly updated with new rigs and therefore it was necessary to use table.insert all the time.
This is what I’m trying to do:
local array = {}
table.insert(array, Instance.new(“part”, workspace), task.spawn(function))
This error is displayed: invalid argument #2 to ‘insert’ (number expected, got Instance)
Although there is an error, the code works like a clock, even in those parts where the array I need appears. Will the code work just as well when I publish the game?