ID:175661
 
I have a Click() thingy to attack something in my game. It works fine, except for one thing. I want to only be able to attack something that's next to me when i click it, not something all the way across the screen. Thanks for the help!
Click(mob/M in oview(1))

I think that's what your looking for.
In response to Jnco904
sadly... jnco... i've already tried your solution and it does not work for some reason.
In response to Konomendragon
Click()
set src = oview(1)
In response to Jotdaniel
that doesn't work either... here's what i've got

<font size-1>
<font face="courier">
mob
enemy
bat
icon='bat.dmi'
Click()
set src=oview(1)
attack(src)
In response to Konomendragon
try set src in oview(1)
In response to Konomendragon
maybe change Click() to Click(M as mob in oview(1))
In response to Jem
Mob as M is the same as mob/M.
No, no, set src in blah will not work for Click(). You need to use get_dist() to check how close you are. Here's an example:

mob/Click()
if(get_dist(usr,src) <= 2) //If you're two or closer spaces to what you clicked
//Run your attacks
In response to tenkuu
ok, never used a click verb before. :)
In response to tenkuu
Thank you tenkuu... you have solved my problem

<BIG><BIG><BIG><font color="blue"> Wahoo!