ID:273572
 
Hi. I've recently fixed my Combat System, now my question is how can I give the "Slash" Command only if a user has a Wooden Sword? By default they start with it after choose their hair (Slash'd be like Attack).

I don't want to change the "Usr.Icon State"; I want the wooden sword overlay to change it's state. I don't know very well what to do with this, If somebody could help me, I'd really thank he/she.

Well, that's all I need. Thank you for your help guys :)
Perhaps you want flick()?
Look into the Flick proc as mentioned by ghost using the DM reference

then you will also need to search the forums for giving procs etc on equip
I've changed Attack to this:

verb/Attack(mob/M in oview(1))
set category = "Battle"
flick('Sword.dmi',usr)
flick("WAttack",usr)
var/damage = src.Strength - M.Defense
if(M.client)
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
src.level_up()
M.death_check(src)
else
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
var/random = rand(1,3)
if(random == 1)
src.Exp += 4
if(random == 2)
src.Exp += 3
if(random == 3)
src.Exp ++
src.level_up()
M.death_check(src)

But still, when I wear Sword and I use Attack it turns my Icon invisible and after secs it appears.
In response to Eternal_Memories
Eternal_Memories wrote:
I've changed Attack to this:

verb/Attack(mob/M in oview(1))
set category = "Battle"
flick('WAttack',usr)
var/damage = src.Strength - M.Defense
if(M.client)
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
src.level_up()
M.death_check(src)
else
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
var/random = rand(1,3)
if(random == 1)
src.Exp += 4
if(random == 2)
src.Exp += 3
if(random == 3)
src.Exp ++
src.level_up()
M.death_check(src)

But still, when I wear Sword and I use Attack it turns my Icon invisible and after secs it appears.

    verb/Attack(mob/M in oview(1))
set category = "Battle"
flick("WAttack",usr)// this is Case Sensitive the icon state in both icon files has to be WAttack it will flick both.
var/damage = src.Strength - M.Defense
if(M.client)
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
src.level_up()
M.death_check(src)
else
M.Health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
var/random = rand(1,3)
if(random == 1)
src.Exp += 4
if(random == 2)
src.Exp += 3
if(random == 3)
src.Exp ++
src.level_up()
M.death_check(src)