ID:1630905
 
(See the best response by GhostAnime.)
Code:
world
New()
new /mob/BeyM/Ray(locate(4,4,1))
mob
var
player_mob
mob
Login()
if(src.client.mob == src)
..()
src.player_mob = client.mob
world << "Welcome, [src]"
src.loc = locate(1,1,1)
mob
BeyM
Bump(mob/BeyM/A)
if(istype(A,/mob/BeyM/))
new /obj/Sparks(src.loc)
walk_away(A,src,5)
walk_away(src,A,5)

mob
verb
Summon()
//var/player_mob = client.mob
var/mob/BeyM/Ray/R = new(usr.x,usr.y,usr.z)
R.owner = src
client.mob = R
mob
verb
Return()
client.mob = player_mob


Problem description: I'm able to change to the BeyMonster, but i can't change back. I've tried every single way i could. Also, it always sends me to the starting place when i change into the BeyMonster can anyone help me?
Best response
(1)
world
New()
new /mob/BeyM/Ray(locate(4,4,1))

If you will have instances of world/New() defined elsewhere, remember to call ..(); if this is and will be the only one, you do not need ..() since there's no default action for it in DM.

mob/var/mob/player_mob  //  any /path/ after var tells the DM the type/path of the variable. So this is telling DM that player_mob is a /mob type.
... Login() ...
src.player_mob = src //client.mob


Try setting player_mob as src rather than client.mob; see if that helps resolve your issue.
Now, i want to make a if for when i turn into the mob. It won't do the login procedure like it always does.