NOTE: I am doing this because I do not know how to make a library!
This is a readymade 'switching character' function and command. You can use this to switch between characters.
NOTE:You go in an order. I will update this so it'll show a menu(I'm too lazy now.)
Function
if (player.character = "Character 1") {
msg ("You are playing as the second character.")
player.character = "Character 2"
c1.scenery = false
c2.scenery = true
MoveObject (player, c2.parent)
}
else if (player.character = "Character 2") {
msg ("You are playing as the third character.")
player.character = "Character 3"
c2.scenery = false
c3.scenery = true
MoveObject (player, c3.parent)
}
else if (player.character = "Character 3") {
msg ("You are playing as the fourth character.")
player.character = "Character 4"
c3.scenery = false
c4.scenery = true
MoveObject (player, c4.parent)
}
else if (player.character = "Character 4") {
msg ("You are playing as the fifth character.")
player.character = "Character 5"
c4.scenery = false
c5.scenery = true
MoveObject (player, c5.parent)
}
else if (player.character = "Character 5") {
if (GetBoolean(c6, "locked")) {
msg ("You are playing as the first character.")
player.character = "Character 1"
c5.scenery = false
c1.scenery = true
MoveObject (player, c1.parent)
}
else {
msg ("You are playing as the sixth character.")
player.character = "Character 6"
c5.scenery = false
c6.scenery = true
MoveObject (player, c6.parent)
}
}
else if (player.character = "Character 6") {
msg ("You are playing as the first character.")
player.character = "Character 1"
c6.scenery = false
c1.scenery = true
MoveObject (player, c1.parent)
}
}
</function>
Command
<command name="switch">
<pattern>switch</pattern>
<script>
SwitchCharacter
</script>
</command>
NOTE:Change your changeable character's names to 'c1' 'c2' etc. or it will not work! You can make what the player sees as the alias. If you have less than six characters then remove the needful. If you have more than six characters then learn from the code!If you want you can copy your game's code and paste it into this file and continue creation after doing the desirable changes. You also
can give me credit(Optional):