![]() |
![]() ![]() ![]() ![]() ![]()
|
Author | Topic: status variable |
gamer1962 |
![]() I am trying to update a status variable. I have objects (coins) all about the game. When you take the coins it is suppose to update the status variable "coin" with the amount of coins you picked up. I cant seem t make this work. all the coin objects have a property called "amount" When the player pick them up the take script runs this code take { the objects name are coin1, coin2... they all have alias names of coins. The problem is that it changes the "coin" status variable to the value of the property "amount" of each coin object instead of adding the value of the property "amount" to the current value of the status variable "coin" |
gamer1962 |
![]() Looking at my own message I think I am using the wrong command for variables, Am I initializing a new varibale coin with the "set numeric" in my code? Should I be using something like |
Computer Whizz |
![]() You should be using: set <coin; %coin% + #coin1:amount#> Since the variable is declared as a status variable it doesn't need to be declaired again - and you just re-adjust the variable to %the variable% plus #collected coins#. Computer Whizz |