Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need a help!
- itamaryaffe
-
4 posts
I need a help!
I wanna do a variable is changed by another variable, is changed, when I'm pressing a key.
When I do that, the value of the first variable increased too much.
It needs to change by (the other variable)/100 but it changes very larger than that.
I need a help from you!
Thank you,
itamaryaffe
When I do that, the value of the first variable increased too much.
It needs to change by (the other variable)/100 but it changes very larger than that.
I need a help from you!
Thank you,
itamaryaffe
- Griftor05
-
13 posts
I need a help!
um, you might want to try this out.
Header Bit: When Key (whatever_key_you_want) Pressed:
then put: change variable (the_variable_you're_changing) by (Variable_2 inside of a math division where one side is var2, and the other is 100)
then, optionally: End Script (is this still in 2.0? I should check that, although it was pretty redundant in 1.4, so probably not)
Header Bit: When Key (whatever_key_you_want) Pressed:
then put: change variable (the_variable_you're_changing) by (Variable_2 inside of a math division where one side is var2, and the other is 100)
then, optionally: End Script (is this still in 2.0? I should check that, although it was pretty redundant in 1.4, so probably not)
- ErnieParke
-
1000+ posts
I need a help!
Yes, end script is still in 2.0, as well as [stop [all v]] and [stop [other scripts in sprite v]]. Also, end script is actually now [stop [this script v]]. um, you might want to try this out.
Header Bit: When Key (whatever_key_you_want) Pressed:
then put: change variable (the_variable_you're_changing) by (Variable_2 inside of a math division where one side is var2, and the other is 100)
then, optionally: End Script (is this still in 2.0? I should check that, although it was pretty redundant in 1.4, so probably not)
With regards,
ErnieParke
Last edited by ErnieParke (June 23, 2013 19:56:22)
- greenflash
-
18 posts
I need a help!
um, you might want to try this out.
Header Bit: When Key (whatever_key_you_want) Pressed:
then put: change variable (the_variable_you're_changing) by (Variable_2 inside of a math division where one side is var2, and the other is 100)
then, optionally: End Script (is this still in 2.0? I should check that, although it was pretty redundant in 1.4, so probably not)
Instead of End Script, you could do this:
Forever
If “whatever key” is pressed
Change variable 1 by ( (variable 2)/100 )
wait until <not “whatever key” is pressed>
-end of if -
-end of forever loop -
Last edited by greenflash (June 23, 2013 19:30:38)
- Discussion Forums
- » Help with Scripts
-
» I need a help!