First problem:
You'll need to use '==', not '=' for comparisons. When you use only one equal sign, you're actually setting the variable p1character to 0 and returning true.
The second problem:
0 doesn't need to be wrapped in quotes. You use quotes when your're dealing with strings, but not when you're dealing with numbers:
so, it should look like this:
PHP Code:
if (p1character == 0)
{
player1.value="Fred";
p1charpic.gotoAndStop(2);
}
to avoid getting the same random number twice:
PHP Code:
var p1character=Math.round(Math.random()*4);
do { var p2character=Math.round(Math.random()*4); }
while ( p2character == p1character; )
this will keep trying new random values for the second character until it doesn't match the 1st.
And a piece of advice - you should really look into using Arrays. Your code could be brought down to just a few lines that way, much less repetitive code.