This is my first foray into scripting. I did some research prior and have tried a couple different inputs. So far this is the only one I've tried that doesn't crash the game with a scripting error but it doesn't actually give the player any pokemon:
What is the appropriate way to make an event tile give a random reward?
I would advise you to use a RMXP variable and assign your random value to it. I would advise you to use a RMXP variable and assign your random value to it. By default, it is variable 7 for Essentials.
Afterwards, you can use the conditions "If variable = 0, 1, 2 or 3" to give the appropriate consequences to the continuation of your adventure (for example: quote the good name of your starter or modify the team of the rival).
$game_variables = rand(4)
if $game_variables == 0
elsif $game_variables == 1
elsif $game_variables == 2
else #Ensure that at least one starter is given
$game_switches = false #Switch used *in Essentials to determine whether the player is in the middle of choosing a starter.
Also, Beware of the ruby syntax : it's "elsif" and not "elseif".
If the script is entered in an event-making command, it must be in one block. Otherwise, your instance variable "random3" is lost and returns "nil", which will generate an inequality on all your comparisons, so only false conditions.