ID:143056
 
First off I take no credit in making this I saw it in a source I had.
Code:
mob/var/ghostedmob = 0
mob/var/originalmob = 0
mob/var/switched = 0


mob/owner/verb/Body_Switch_Ghost_Thing(mob/M)
if(M.client)
if(usr.switched==0)
var/mob/P = new(M.loc)
P.density = 0
var/temploc = usr.loc
var/temploca = M.loc
P.key = M.key
M.key = usr.key
M.switched = 1
M.originalmob = usr
M.ghostedmob = P
walk_towards(P,M)
M.loc = temploc
P.loc = temploc
P.client.eye = M.client.eye
usr.loc = locate(temploca)
else
if(M != usr.originalmob) usr << "Back in your body first!!"
if(M != usr.originalmob) return
usr.switched=0
var/temploc = usr.loc
var/temploca = M.loc
M.key = usr.key
var/mob/P = usr.ghostedmob
usr.key = P.key
del(P)
M.loc = temploc
usr.loc = locate(temploca)
else
switch(input("WARNING: Doing this will cause your key to log out, and you cannot switch back! CONTINUE?")in list("Yes","No"))
if("No")
usr << "Ok good!"
else
if(usr.switched==0)
var/mob/P = new(M.loc)
P.density = 0
var/temploc = usr.loc
var/temploca = M.loc
P.key = M.key
M.key = usr.key
M.switched = 1
M.originalmob = usr
M.ghostedmob = P
walk_towards(P,M)
M.loc = temploc
usr.loc = locate(temploca)
else
if(M != usr.originalmob) usr << "Back in your body first!!"
if(M != usr.originalmob) return
usr.switched=0
var/temploc = usr.loc
var/temploca = M.loc
M.key = usr.key
var/mob/P = usr.ghostedmob
usr.key = P.key
del(P)
M.loc = temploc
usr.loc = locate(temploca)


Problem description:The problem is well I dont know and all I know is that it logs you out when you use it.
But what it is suppose to do is let you control another mob and freeze the person your controling until you switch back to your body, and not allow the usr to do anything else such as use that mobs verbs and access its inventory.


First, you probably wouldn't know what it does because it's not yours.

Second, it's more efficient I believe to modify Move() for movement control.
mob
var/controlled //If mob is being controlled
var/mob/control //Mob being controlled
Move()
if(control)control.loc=loc
if(!controller)..()

Note: There may be a cleaner way.
In response to Kaiochao2536
First: I know what it does because it came out a game we all know a naruto game and if you must know what it is for which you will not know what im talking about its for Ino's clan which allow you to take someones mind over.

Two: I guess I should have said could you fix the code, I know what you did will probably be easier I prefer to have that code fixed.
In response to Tcoo
Here, you can borrow some of mine:

.........................................

A little tip: if you're copying somebody else's code, you're on your own when it doesn't work, because the majority of respectable programmers (the kind of people who help people with code problems) are unwilling to help people rip games. For this reason, you shouldn't copy anything that you couldn't write yourself.
In response to Garthor
I know what game that's from and the version you are trying to run it from was extremely buggy, and I know Raii wouldn't like you to go around flashing to the whole community that you are making a rip. I advise you to scrap that code and the entire source, because its worthless and the right thing to do.