(See the best response by Albro1.)
        NewMob(mob/M, F as file)
var/mob/Oldmob = M.client.mob
var/MobPath = "/mob/Player/[lowertext(F["Class"])]"
NewMob = new MobPath()
M.client.mob = NewMob

So i run this after logging in and it gives the error

runtime error: Cannot modify null.mob.
proc name: NewMob (/mob/proc/NewMob)
source file:,36
usr: the thunderz (/mob/new_player)
src: the thunderz (/mob/new_player)
call stack:
the thunderz (/mob/new_player): NewMob(the thunderz (/mob/new_player), savefiles/telnet/players/thund... (/savefile))
the thunderz (/mob/new_player): Login()

Problem description:
Basically I'm trying to create a new mob and set the mob to the clients mob.
please any help would be appreciated.
Best response
Why not just take client/C as an argument instead of mob/M?
NewMob(client/c, f)
// bla bla
c.mob = //bla bla

Just an idea to avoid any possible mob confusions going on here.
Hmm okay ill try it one minute.
okay it no longer is getting an error...but i must be creating the mob wrong or something ;/ mob/Player/Logout() isn't being called or something on logging out..

It works when first creating the character but if you login with that mob creation process and logout mob/Player/Logout() isn't called..

Nevermind i figured everything out solved.