ID:140505
 
Code:
obj
Ki_Blast
icon='KiAttacks.dmi'
icon_state="4"

Click()

if(usr.charge==1)
usr.icon_state="charge"
usr.overlays+= /obj/chargez
usr.chargefire++

if(usr.charge==1 && usr.chargefire>=2)
var/obj/kiblast/K3 = new
usr.overlays -= /obj/chargez
K3.loc = locate(usr.x,usr.y,usr.z)
walk(K3,usr.dir,1)
sleep(1)
usr.icon_state=""
usr.chargefire=3

if(usr.chargefire==3)
usr.chargefire=0


Problem description:

It will add the icon as a overlay but for some reason it fails to remove it i dunno if i made a mistake or if this is a bug

You made a mistake. Any time you would remove an overlay, you're adding a new one immediately before, so you end up leaving the old overlay.

Or possibly replacing the old overlay. I'm not sure what order it goes in... it's indistinguishable anyway.
In response to Garthor (#1)
so what should i do to fix this should i reorder the sections of code or what
In response to Mastergamerxxx (#2)
You should change it so that it doesn't add an overlay if you are intending to remove an overlay.