ID:142373
 
Code:
    Attacks/verb
Slash()
set category="Fighting"
if(src.Attacking == 0)
flick("SwordSlash",src)
var/obj/K = new/obj/Sword
src.Attacking = 1
K.dir = src.dir
K.loc = src.loc
step(K, dir)
var/turf/X = K.loc
spawn(6)
del(K)
for(var/mob/M as mob in X)
if(M.PKon==1)
src<<"There Pk isnt enabled"
return
else
if(M == src)
continue
var/colour = "lightcoral"
var/damage = rand(src.Str)
if(prob(70))
src<<"You attack [M] for [damage] damage!"
M<<"[src] attacks you for [damage] damage!"
s_damage(src,damage,colour)
M.Health -= damage
if(M.Health <= 0)
Death(M)
else
src<<"You attempt to attack [M] but miss!"
M<<"[src] attempts to attack you but misses!"
sleep(7)
src.Attacking =0


Problem description:

the problem is that whenever i attack someone while there pk isnt activated, it says what its suppose to say "There pk isnt enabled" but then after that i can never slash the sword again, its like when i wrote return it never allows the sword to swing again how do i fix
You must change src.Attacking back to 0 before calling return.
                        src<<"There Pk isnt enabled"
src.Attacking = 0
return

                    sleep(7)
src.Attacking =0


These two lines should not be inside the for() loop. Unindent them once. As it is, your ability to attack again is tied in with successfully hitting something.