ID:160592
 
verb
attack(mob/M as mob in oview(1))
if (M.HP <= 0)
usr << "[M]dead" else
usr << "You attack [M]!"
oview() << "[usr] atta [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()

How do i make a delay for attack
    verb
attack(mob/M as mob in oview(1)) //if you have nothing but mobs surrounding you, it'll attack all of them. get_step could prove useful.
//pointless check, if it's dead, it should be gone
sleep(src.var_name_goes_here)
usr << "You attack [M]!"
oview() << "[usr] attack [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()

Basically, the way to do it. Nothing fancy.
In response to DemonSpree
1. It's impossible to have nothing but mobs surrounding you, because you are always adjacent to a turf & an area.

2. If you have multiple mobs around you, there will be an input box asking which mob you want to attack.
    verb
attack(mob/M as mob in oview(1))
if(attacking) return
attacking=1
spawn(5) attacking=0
//You need to pick your delay in 1/10 seconds timing
if (M.HP <= 0)
usr << "[M]dead" else
usr << "You attack [M]!"
oview() << "[usr] atta [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()
mob/var/tmp/attacking=0//Its a tmp so it doesnt save the amount.


The other two people who posted here were very wrong. I didn't fix any exsisting code, I just added what you wanted.