| Blockland Forums > Help |
| VCE Money help |
| (1/2) > >> |
| Bosie1997:
Can someone please tell me how to make a event so that if you have ____ wood, you get ____ money? For example I am making an RPG where you chop down trees for lumber. How do I make it so you get 1 credit for each lumber? |
| zenloth:
[0] [OnActivate]>[Self]>[VCEifValue] > [var:cl:wood] [>=] [1] > [1 2] [1] [OnVariableTrue]>[self]>[VCEmodVar]>[client] [wood] [subtract] [1] [2] [OnVariableTrue]>[self]>[VCEmodVar>[client] [monies] [add] [1] [3] [OnVariableTrue]>[self]>[VCEifValue] > [var:cl:wood] [>=] [1] > [1 2] [4] [OnVariableFalse]>[client]>[CentrePrint]>[All your wood is now magically money!] I think that should work. |
| zenloth:
--- Quote from: zenloth on March 29, 2010, 12:24:30 PM ---[0] [OnActivate]>[Self]>[VCEifValue] > [var:cl:wood] [>=] [1] > [1 4] [1] [OnVariableTrue]>[self]>[VCEmodVar]>[client] [wood] [subtract] [1] [2] [OnVariableTrue]>[self]>[VCEmodVar>[client] [monies] [add] [1] [3] [OnVariableTrue]>[self]>[VCEifValue] > [var:cl:wood] [>=] [1] > [1 4] [4] [OnVariableFalse]>[client]>[CentrePrint]>[All your wood is now magically money!] I think that should work. --- End quote --- Wait wait, change the subsystem boxes to this - That first one wont work [1 2] becomes [1 4] |
| TheBlackParrot:
Better yet, why not let the user define the amount he wants to trade by chatting it? 1: onActivate > Client > CenterPrint > <color:ffffff>Please chat the amount you wish to trade.<br>Click me again once you have. 2: onActivate > Self > VCE_ifValue > <var:cl:wood> >= <var:cl:lastmsg> > 3 7 3: onVariableTrue > Client > VCE_modVariable > Wood > Subtract > <var:cl:lastmsg> 4: onVariableTrue > Client > VCE_modVariable > Cash > Add > <var:cl:lastmsg> 5: onVariableTrue > Client > ChatMessage > <color:009900>Cash: <color:ffffff><var:cl:cash> [+<var:cl:lastmsg>] 6: onVariableTrue > Client > ChatMessage > <color:663300>Wood: <color:ffffff><var:cl:wood> [-<var:cl:lastmsg>] 7: onVariableFalse > Client > ChatMessage > <color:ff0000>Please specify a number less than <var:cl:wood>. |
| phflack:
you might be able to check if it's numbers only, not sure how i would do that though |
| Navigation |
| Message Index |
| Next page |