Change player type using dialogue options

How to make a script that when a player with player type “new player” presses an option of a dialogue called “Join pirate team” the player type changes to “Pirate” Player type.

Note, the player type “new player” is from the moment the players enter the game, the same as the dialogue.

Summary of what I need, change the player type “new player” to “Pirate” using the option “join pirate team” from the start dialogue.

In the next images I have what i did




Hmmm, first you need to understand that modd.io games should be designed to accept multiple players in a single server. Single player game is not supported on modd.io.

You’re currently using global variable (such as playerJoinedMarineTeam?). Global variable is shared across ALL players, so it’s not suitable here. For this purpose, you don’t need a variable. Instead, you want to use assign (player) to (player type) (the one used in the first line of player joins script) in order to assign the dialogue selector to either Pirates in Join Pirates script or Marine in Join Marine one.

And you’re using a for loop to open a dialogue for ALL players whenever a new player joins. But you shouldn’t show a welcome dialogue to everyone whenever a new player joins. Don’t forget to change it to open dialogue Welcome for (last triggering player) so that only the new player sees the dialogue.