ID:178343
 
Hey, can someone tell me how to make a verb that you can click on, and click again to turn off?

please respond,
thanks
Example-
mob
var
verbon=0

verb
if (usr.verbon=0)
usr<<"you turn it on"
else
usr<<"you turn it off"

In response to Emperor Beld
Emperor Beld wrote:
Example-
mob
var
verbon=0

verb
if (usr.verbon=0)
usr<<"you turn it on"
else
usr<<"you turn it off"


Wow... That did exactly what he didn't want it to do.

1. You didn't define an actual verb..
2. That would do nothing but always display "you turn it on".
<code> mob var my_var = 0 verb My_Verb() if(!my_var) usr << "You turn on the verb." usr.my_var = 1 else usr << "You turn off the verb." usr.my_var = 0 </code>

Is that what you need?

-Rcet

In response to Rcet
Ok, that's what I needed...thanks
In response to Rcet
Rcet wrote:
Emperor Beld wrote:
Example-
mob
var
verbon=0

verb
if (usr.verbon=0)
usr<<"you turn it on"
else
usr<<"you turn it off"


Wow... That did exactly what he didn't want it to do.

1. You didn't define an actual verb..
2. That would do nothing but always display "you turn it on".

oops forgot to put that in there it was my beddie by time and I'm still not asleep :(
<code> > mob > var > my_var = 0 > verb > My_Verb() > if(!my_var) > usr << "You turn on the verb." > usr.my_var = 1 > else > usr << "You turn off the verb." > usr.my_var = 0 > </code>

Is that what you need?

-Rcet

In response to Rcet
Rcet, it would also return missing expression (since it was = and not ==) =)
In response to Garthor
Or....
mob/var/switch=0
mob/verb/TurnSwitch()
switch = !switch


Alathon