ID:263617
 
Code:
    proc/CreateCharacter()
var/mob/new_mob //We are declaring a new variable called "new_mob" which will be used in a little minute
var/char_name // We set a var for the characters name here and make it "null"
while(!char_name) // Here we check to see whether the characters name is null or text, if null we don't allow them in, if text, they are allowed in
char_name = input("Please put your character name in here.","Name") as null|text //The player makes their name here
var/char = input(src,"Pick your character!") in list("Trainer","Pokemon") //The player chooses his/her character here
switch(char)
if("Trainer")
src.Race = "Trainer"
switch(alert("Which Trainer would you like to be?","Trainer","Lucas","Dawn"))
if("Lucas")
new_mob = new /mob/player/trainer/lucas


Problem description:I made it so when you choose trainer it gives u a statspannel,so I Picked trainer and it gave me the stats then when I picked which trainer I wanted to be the statpannel went away,here is the statpannel code.

mob/Stat()
if(src.Race == "Trainer")
stat("Trainer Name:",src.name)
stat("Poke Dollers:",src.gold)
stat("Current Location:","[usr.x],[usr.y],[usr.z]")
statpanel("Backpack",contents)

if(src.Race == "Pokemon")
stat("Pokemon Name:",src.name)
stat("Level:",src.level)
stat("Health:","[usr.HP]/[usr.MHP]")
stat("PP:","[usr.PP]/[usr.MPP]")
stat("Strength:",usr.Str)
stat("Experience:","[usr.Exp]/[usr.Mexp]")
stat("Current Location:","[usr.x],[usr.y],[usr.z]")
That's because you're creating and (I assume) moving to a new mob. The new mob does not share any of the variables as the old mob (except for key and ckey, which are used to identify which player a mob "belongs" to).

However, there's a better way than using the Race variable: just give the mob/player/trainer a different Stat() proc than the mob/player/pokemon.

Also: don't use usr and src interchangeably within a proc, even if they should be (the key word here is "should") the same. Stick to one or the other (I'd suggest src).
In response to Garthor
Thanks its working now ^^.
In response to Element Hero creator
also i think "poke dollars" are just called poke'