ID:261181
 
ok
i have made some punching bags (and they are mobs, and im not making a dbz game) but everytime i attack them they dissapear.
please help me!!
Pikkon The Great wrote:
ok
i have made some punching bags (and they are mobs, and im not making a dbz game) but everytime i attack them they dissapear.
please help me!!


try adding this into the attack code


if(istype(M,/mob/Punchingbag))
Statup()
Levelup()
else
//Rest of the attack code

This will not check to see if the Punchingbag's health is gone and make it dissappear making it so when the Punching Bag is attacked it doesn't lose health.
In response to Nadrew
where in the code?
In response to Pikkon The Great
Pikkon The Great wrote:
where in the code?

mob/verb/Attack()//This makes it so you can attack any mob within one tile of you
set src in oview(1)
var/damage=2*usr.Level//This makes a damage var
if(src==usr)
..()
<font color=red>
else if(istype(src,/mob/Punchingbag))
Statup()
Levelup()</font>
    else
src<<"[usr] has attacked you"
usr<<"You Attacked [src]"//this outputs a certain msg
src.Health-=damage//This takes the amount that the damage var equals from M's health
usr.Exp+=10
usr.Statup+=1
if(src.Health<=0)
src.Health=src.MaxHealth
src.loc=locate(1,1,1)//Change these numbers to the location you want the defeated person to go after he/she dies
Levelup()//This calls the Levelup proc as defined in the other file
Statup()



<FONT COLOR=RED>NOTE:</FONT>DON'T COPY PASTE THAT CAUSE I DIDN'T GET THE INDENTATION RIGHT IT JUST SHOWS WHERE TO PUT IT