ID:143819
 
Code: A prob without an error
Attack()
set category= "Combat"
set src in oview(1)
if(usr.str<=2)
usr << "You killed the spider! You gain 10 XP for Strength!"
usr.strxp+=10
del src
else
usr.hea-=5
usr << "You have a low Strength! You lose 5 health!"


Problem description:I get no errors when I compile it, I tried an code like this:
else
if(usr.str>=1)
usr.hea-=5
usr << "You have low Strength! You lose 5 health!"

But this ends up as an error ("if" statement is not needed, then, statement is not needed). I tried switching src with usr, still doesn't work. Any help?

That's because your indentation is all over the place. You need to fix that.
In response to Garthor
It just looks that way in the forum, now if that is a problem it would come up as an error correct?
In response to DadGun
Well, my problem right now is that, due to your indentation, I have almost no way of telling what YOUR problem is. However, considering the error you're getting, I'd put money on "indentation."

Final answer.
In response to Garthor
obj
spider
verb
Attack()
set category= "Combat"
set src in oview(1)
if(usr.str<=2)
usr << "You killed the spider! You gain 10 XP for Strength!"
usr.strxp+=10
del src
else
usr.hea-=5
usr << "You have a low Strength! You lose 5 health!"
icon= 'spider.dmi'
name= "Spider"

I press Tab to indent.
In response to DadGun
Sorry to act like a jackass though...but I am extremely frustrated, what indentation should I make?
In response to DadGun
The prob was simple: change < to >