Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Cloud Variable help
- SynphonyKnight
-
61 posts
Cloud Variable help
I need to figure out how to change a Cloud Variable. I mean like, if you had a variable “Money”, and the maximium amount f money each player can hold is 99 (so 2 digits for each player). Lets say there are 5 players online, so the variable would be 0000000000, 2 zero's for each player. Now what I want to know is if Player 4 gets 7 money, how would I make the system know to change the variable to 0000000700?
I had some ideas, but none worked. Hope someone can help!
I had some ideas, but none worked. Hope someone can help!
- GuyFauwx
-
14 posts
Cloud Variable help
Maybe this: The player have numbers: player one has: 01-99, player two has 0100-9900, player 3 has 010000-990000 and so on and so on.
and then you just add the money*usernumber.
Example:
User1 is 10, User two is 1000, User 3 is 100000.
User2 gets “Ammount” money:
User2 is a variable. You add as many variables as you want players in the game.
In this case, User2 variable is 1000, so if Ammount is 7, it would do the math like this:
So the new “money” variable would look like this:
“007000”
and then you just add the money*usernumber.
Example:
User1 is 10, User two is 1000, User 3 is 100000.
User2 gets “Ammount” money:
change (money) by ((User2)*(Ammount))
User2 is a variable. You add as many variables as you want players in the game.
In this case, User2 variable is 1000, so if Ammount is 7, it would do the math like this:
change (money) by ([1000]*[7])
So the new “money” variable would look like this:
“007000”
Last edited by GuyFauwx (April 1, 2014 07:29:12)
- Discussion Forums
- » Help with Scripts
-
» Cloud Variable help