How to make a mesh on a part that has mesh collision? (through scripts)

Sorry if this is supposed to be building support.
So basically I cannot make a mesh part on it’s mesh edited on a script.
If I try to run a script by making a mesh part on it’s edited mesh, it will cause an error of assigning property.