Problem During Instantiation

I have tried all different methods that i could find but i still can’t seem to find an answer that works. Whenever I try to instantiate the capsule I want it to use the same scripts that are used in the Scripts. If I put the the prefab into the scene I can just drag and drop the Scripts into the places and it works just fine but I want this to happen upon instantiation.

Drag a capsule onto the scene, and drag on the scripts. Then drag the scripted capsule into your project and instantiate.

Script to Instantiate

    public GameObject CapsulePrefab;
	public Vector3 position;
	public Quaternion rotation;
	void OnFunctionCall() {
		GameObject GmeObj = (GameObject)Instantiate (CapsulePrefab, position, rotation);