How would I go about making a plugin that spawns in an enemy?

I already know I have to create a plugin to do so, but how would I get it to the stage where I can create an enemy and place it wherever I want with just the click of a button. I have the script for the brain of the enemy, though it’s not inside the enemy itself, the script is local. One issue I have is that whenever I create a new enemy I use int values(their values are specified by the person using the plugin) outside the enemy so that I can change things inside the local script however, to access the values they need to have a certain name, so if I name them the same thing, the value that I’m trying to access may be the wrong one. How do I name all of the values differently without having to manually change each one? My second issue is that in the script I need to reference the enemy and since each enemy’s name is different(assuming I name them manually) I have to go inside the script myself to reference them. I tried fixing this by allowing the person using the plugin to type in the name as a string value but, I can’t reference an object using a string value so that doesn’t work. It is also probably possible that I’m approaching this all in the wrong way and there is a better way to do all of this