I think I almost have my code working.
it is an auto attack code that makes if you walk in front of a mob it starts attacking.
mob
verb
Auto_Attack()
set category = "Skills"
if(auto_attack == 0)
src << "You are now auto-attacking."
auto_attack = 1
if(auto_attack == 1)
src << "You are no longer auto-attacking."
auto_attack = 0
Bump(mob/M)
var/autodamage = powerlevel/2
if(auto_attack == 1)
if(istype(M,/mob))
flick("attack",usr)
M << "[text]"
usr << "\red You hit [M]"
M.attacker = src.name
M.powerlevel -= autodamage
M.DeathCheck(src)
usr.cooldown = 1
spawn(usr.speed * 2) usr.cooldown = 0
if(auto_attack == 0)
return
Problem description:
I know whats going on in my code, but every time I turn it on, it turns right off.
--------------------------------------
(Example)
"You are now auto-attacking."
"You are no longer auto-attacking."
---------------------------------------
So can someone tell me how I can make it work. I got it from here, and I'm going to work on it until someone reply, Thanks ahead of the time for the help :D