ID:269763
 
I want to make a skill that creates a shadow and u take control of it and it only works in ur view then if u bump into sum1 it will take control of them for 10 seconds. I dont know how to make it so i can take control of another mob.
There are two simple ways you could try to control another mob. One, editing the player's "key" variable to your own.

mob/verb/control(mob/M in world)
M.key = src.key


The huge problem is, the other player would be logged out.

The second way is to make the other person do something when you do it. I assume you'd want to control movement for a start, so we can overwrite client/Move().

mob/var
mob/controlling

client/Move(l, d)
if(mob.controlling)
return mob.controlling.Move(l, d) // call the other person's client move proc
return ..() // otherwise, move normally


This is just how to overwrite movement.

~~> Dragon Lord
In response to Unknown Person
ok but how would i start off by controling an object that i summon and then if it bumps into someone while controlling it then it takes control..
In response to Kurosaki_Ichigo-San
Ok..This is how you woulddo it..

Make a verb/proc that creates the "being" near or around the character or whatnot and make it the thing the player is controlling using Unknown's snippet. For the bumping part, I'm nottoo good with dat.