ID:263391
 
Code:
mob/player/Destroy/verb/Fire()
set hidden=1
for(var/turf/Wall/T in get_step(usr,usr.dir))
if(T in get_step(usr,usr.dir))
flick("[usr.icon_state]attack",usr)
T.hp -= (rand(10,100))
if(T.hp<=0)
T.density=0
T.opacity=0
T.icon_state=pick("Floorbroke","Floorbroke2","Floorbroke3")


Problem description: Supposed to allow me to destroy a wall when its in front of me but it doesnt, help would be nice.

- Dark Emrald
Dark Emrald wrote:
Code:
> mob/player/Destroy/verb/Fire()
> set hidden=1
> for(var/turf/Wall/T in get_step(usr,usr.dir))
> if(T in get_step(usr,usr.dir))
> flick("[usr.icon_state]attack",usr)
> T.hp -= (rand(10,100))
> if(T.hp<=0)
> T.density=0
> T.opacity=0
> T.icon_state=pick("Floorbroke","Floorbroke2","Floorbroke3")
>

Problem description: Supposed to allow me to destroy a wall when its in front of me but it doesnt, help would be nice.

- Dark Emrald

Thats not really a Macro. More, like a verb.

mob/player/verb/Destroy()
set hidden=1
for(var/turf/Wall/T in get_step(usr,usr.dir))
if(T in get_step(usr,usr.dir))
flick("[usr.icon_state]attack",usr)
T.hp -= (rand(10,100))
if(T.hp<=0)
T.density=0
T.opacity=0
T.icon_state=pick("Floorbroke","Floorbroke2","Floorbroke3")


That should fix it. I think? Oh and by the way. Macros are something like this. You have to make a .dms file in DM. Then, something like this.

macro
center return "fire"


Oh, and by the way if you want to make a .dms file go to New (where you create code files, icon files, etc.) Type in the name of the file then after that (all together such as:
macros.dms) and then thats it.
In response to Quest Industries
I know what a macro is and how it works :/, All am saying is is there anything wrong wit the verb and why it will not destroy the wall when I press the macro that I assigned it. any ideas why not :/.

- Dark Emrald
mob/player/Destroy/verb/Fire()
set hidden=1
var/turf/T=get_step(src,dir)
if(istype(T,/turf/Wall))
flick("[icon_state]attack",src)
T.hp -= (rand(10,100))
if(T.hp<=0)
T.density=0
T.opacity=0
T.icon_state=pick("Floorbroke","Floorbroke2","Floorbroke3")


I believe this will work.
In response to Mega fart cannon
ok thx.

- Dark Emrald