ID:175547
 
How could i make a system where you click something to target it, then like a cross apears over it but only you can see the cross, and if the guy moves the cross moves with it, but if it goes where you cant see it the crossbows disapear and the target goes null. Then while its targeted if you fire a missle it goes towards the target. Thanks for helping me!
The image() proc is what you nee to place the crosshair. Removing it when someone moves out of sight is a bit trickier.
mob
var
mob/target
target_image

New()
..()
/* create a reusable target_image so we don't
have to keep making and deleting separate ones */

target_image = image('crosshair.dmi',src)

Click()
// if usr has a target
if(usr.target && usr.client)
// clear hte old target image
usr.client.images -= usr.target.target_image
// set usr target and target image
usr.target = src
usr << target_image

Move()
// store a list of what's in sight now
var/list/old_view = view(world.view,src)
. = ..()
if(.) // if the mob moved
var/list/new_view = view(world.view,src)
//check to see if this mob's target is in view
if(target && !(target in new_view))
// clear target and target image
if(client) client.images -= target.target_image
target = null

// make a list of things that are now_out_of_sight
var/list/now_out_of_sight = old_view - new_view
// check each mob we lost sight of
for(var/mob/M in now_out_of_sight)
if(M.target == src) // if it targeted this mob
// clear it's target and target image
if(M.client) M.client.images -= target_image
M.target = null
In response to Shadowdarke
THANKS! But the crosshair wont show above the guy, but the targeting works! Edit: Ignore this message i fixed it