set

Arguments:
any, any (types of the two arguments must match)
Return Value:
second argument

The set statement isn't actually a function, although it's called like a function. The set statement is used to set parameters of characters, objects, and rooms. The first argument is the parameter you wish to set, and the second argument is what it should be set to. Thus the types must match: you can't set someone's gold to a string, for example, it has to be an integer because the gold function returns an integer.

Many MUDL functions can be set, but some cannot. It says in the help for each function whether it is settable or not.

Examples:
   set( gold( %a ), gold( %a ) + 10 )

gives %a (the person who issued whatever command triggered this MUDL script) 10 more gold than he currently has.

   set( values( clasp( %o ) )[ 3 ], 17 )
This illustrates that the first argument can really be just about any complicated expression. This sets the third object value on the clasp of %o to 17. Another important use of the set command is to set flags. For instance to make the current room nogate, you could

   set( flag( %r, 'nogate' ), true )   

See also the unset statement, which can be used to set certain things to "nothing".