Two player characters.

Started by Jon, Wed 27/12/2006 10:47:32

Previous topic - Next topic

Jon

The code I have put in is:

if(player==cTay){
cGinnie.SetAsPlayer();
}
if(player==cGinnie){
cTay.SetAsPlayer();
}
}

Have I added something I shouldn't have?

Ashen

#21
Try:
Code: ags

if(player==cTay){
  cGinnie.SetAsPlayer();
}
else if(player==cGinnie){
  cTay.SetAsPlayer();
}


As it is, the if (player == cTay) condtion will run, making Ginnie the player - but it's immediately followed by the command to change from Ginnie back to Tay. Adding the else should stop that (makes them part of the same condition rather than two seperate sets of commands).
I know what you're thinking ... Don't think that.

Jon

It works fine now, Thanks Ashen!

SMF spam blocked by CleanTalk