I'm almost finishing it, but now I'd like to let the clones use player skills, I did it, but to find the loc of the Clone I did this :
for(var/mob/M in oviewers()) // Here I find the clone
if(M.name == usr.name) // Clones always have the same name of the player
Ativar(M,M.loc,M.dir) // Proc to use skills
My question is, is this 'for' going to cause lag ?
Edit: I forgot the topic =0
'Is there a more efficient way of doing X'.
In your case, probably. For all you know, there might be hundreds of non-clone-or-player characters on screen, to handle this, I'd place all of the players and clones into a list, and just check through that such as: