How do I make a power up?

Hey guys i’m making a 2d game and i want to make a power up where it makes a new 2d character. My script doesn’t work.

var OnCollisionEnter();
{
if(OnCollisionEnter is Collider create new 2dCharacter);
}

Iam Tabu316 if you don’t know how to code you need to learn that first. Once it clicks everything gets easier. Here’s an easy way though. Make a collider trigger and when your character enters the collider have it become the new powered up character. That’s honestly how everybody would probably do it, by using triggers.

function OnTriggerEnter(other : Collider)
{
     if(other.tag == "PowerUp")
     {
          //However you wanna handle it. You can create a new powered up character and destroy the old one, but I personally wouldn't handle it that way. I would just have one copy of each and disable/enable the one that's currently active
     }

}

Your scripting syntax is mixed up in several ways.

First, I think that if you back up a bit, and do a couple tutorials on scripting basics, you’d learn how to avoid some common mistakes, and then be able to do what you want to do faster. At least, that’s what I did, and it worked well for me. For example, the Roll-a-ball tutorial (here) shows how to create a pickup, and creating a pickup is the first part of creating a powerup.

Second, when using standard utility functions like OnCollisionEnter, I suggest you begin by copy/pasting the example from the Scripting API help page, and then customizing the code to fit your needs. The example for OnCollisionEnter() is here:
http://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html

Lastly, I think that a powerup might work better if you gave it a trigger-type collider. You can do this by checking the ‘Is Trigger’ box in the inspector, and using OnTriggerEnter instead of OnCollisionEnter.