ID:168112
 
hello, i want to have the player face the thing he or she clicked i have this but it fails when in range
mob

Click(mob/M)
if(istype(src, /mob/Enemy/Testbaddie))
walk_to(usr, src, 6, 1)
Fire(src)
else
usr << "Name: [src.name] HP: [src.hp]"
usr << "Age: [src.age] Gender: [src.gender]"
usr << "Level: [src.level] Skintone: [src.skintone]"
return

also could you tell me how you can dump the istype(src, /mob/Enemy/Testbaddie) stuff that it only shows the stats on friendlies and fires on enemies whithout a very long if(istype()) list

Thank you in advance
Meganutter
Look up get_step()
In response to Mysame
i'm not able to fit it in, it keeps sayins that the statement has no effect -_-
In response to Meganutter
You could always show the code where it doesn't fit in..
In response to Mysame
ok sorry heres the code
mob

Click(mob/M)
if(istype(src, /mob/Enemy/))
walk_to(usr, src, 6, 1)
get_step(usr,src)
Fire(src)
if(istype(src, /mob/Friendly/))
usr << "Name: [src.name] HP: [src.hp]"
usr << "Age: [src.age] Gender: [src.gender]"
usr << "Level: [src.level] Skintone: [src.skintone]"
return
In response to Meganutter
You want the get_dir() proc. Replace the get_step() line with
usr.dir = get_dir(usr, src)
.
In response to Shadowdarke
wohooooo
thnks alot guys ^^
i found a way without the long if istype list
if(istype(src, /mob/Friendly/))

and
if(istype(src, /mob/Enemy/))


*darn you can sure learn a lot here*