ID:176896
 
I got this code from a tutorial, it makes a clicking icon wherever the user clicks for a few seconds then disapears. How can i change it so it only works if you click on a turf?

mob
var/c=0

client.Click(O)
usr.c=1
walk_to(usr,O)
var/o=image('cursor.dmi',O,"click")
src << o
sleep(2)
usr.c=0
while(get_dist(usr,O) >0)
sleep(2)
if(usr.c==1)
del(o)
del(o)

client.Move()
usr << "Click to move."

Mabe something that does: if src is turf walk there else do nothing
</<>
Instead of refering to client/Click(), set it up to use turf/Click() instead, then it will only happen when you click on turfs.