ID:145104
 
Code:
    Attack(mob/M as mob in oview(1))
if(M.name = "dummy")
set hidden
else

set category="Attack"
var/damage = usr.str - M.def
usr<<"You attack [M] for [damage] damage!"
oview()<<"[usr] attacks [M] for [damage] damage!"
M.HP -= damage
M.Death()
usr.LevelUp()


Train(mob/Monster/dummy as mob in oview(1))
set category="Attack"
usr << "You train on the dummy"
oview()<<"[usr] trains on dummy!"
usr.Exp += rand(1,15) - usr.Level
usr.LevelUp()


Problem description:
I'm trying to make it so the player can only train on the dummy not attack it. How to I do this? When I try the above it says on the:

if(M.name = "dummy")
set hidden

errors:
Verbs.dm:13:error::missing expression
Verbs.dm:14:error:hidden :bad statement

That's because "set" statements are not actual statements in the procedure. They are a rather strange syntax quirk -- they set the properties of the verb, but have no actual functions.
To fix the errors, you need an == operator, and it's set hidden = 1. But that code probably won't work properly anyway.

EDIT: Couldn't you solve your problm by making the dummy a obj instead of a mob.

Maybe like..

obj
Dummy
icon = 'blah.dmi'
verb
Train()
set category="Attack"
set src in oview(1)
usr << "You train on the dummy"
oview()<<"[usr] trains on dummy!"
usr.Exp += rand(1,15) - usr.Level
usr.LevelUp()
In response to Evidence
Evidence wrote:
To fix the errors, you need an == operator, and it's set hidden = 1. But that code probably won't work properly anyway.

EDIT: Couldn't you solve your problm by making the dummy a obj instead of a mob.

Maybe like..

> 
> obj
> Dummy
> icon = 'blah.dmi'
> verb
> Train()
> set category="Attack"
> set src in oview(1)
> usr << "You train on the dummy"
> oview()<<"[usr] trains on dummy!"
> usr.Exp += rand(1,15) - usr.Level
> usr.LevelUp()
>
>



*smacks self in the face* thank you, didnt even think of that.