Ok so in my game I have a thing where you press X and two things come up to give something experience. My character runs over them initiating the experience. Then they hide. But I want it to not be re-used to give infinate experience so how do I stop the effects of the X button?
Last edited by imsosuperswell1 (2012-02-21 20:03:50)
Offline
when gf clicked set (sprite works v) to [1] forever if <(Sprite works) = [1]> wait until <touching (sprite1 v)?> your script here set (sprite works v) to [2]
Offline
Slayerrobe's script is relevant.
when gf clicked set [exp v] to (0) set [exp_enabled v] to (1) forever if <(exp_enabled) = (1)> wait until <touching [sprite1 v]?> change [exp v] by (1) set [exp_enabled v] to (0) end
Last edited by Magnie (2012-02-21 20:58:58)
Offline
Do you want me to actually show you the script I am trying to use but failed? I may can't cause I fail at the scratchblock thing.
Offline
imsosuperswell1 wrote:
Do you want me to actually show you the script I am trying to use but failed? I may can't cause I fail at the scratchblock thing.
The script does exactly what you want. The sprite that the character walks over, waits until the user walks over it, and then it gives 1 exp then it won't give anymore after that.
Last edited by Magnie (2012-02-21 21:05:57)
Offline
But the script is enabled by the X button which broadcasts Item, then the script initaites. So can you incorperate that into there?
Offline
when gf clicked set [button_pressed? v] to (1) forever if <(button_pressed?) = (1)> wait until <touching [sprite1 v]?> broadcast [Item v] set [button_pressed? v] to (0) endHow about that? You could also use this script:
when gf clicked set [button_pressed? v] to (1) forever if <<(button_pressed?) = (1)> and <touching [sprite1 v]?>> broadcast [Item v] set [button_pressed? v] to (0) endAnd whenever you want to reactivate the button or deactivate, you can just set the button_pressed? variable to 0 to deactivate or 1 to activate.
Offline
No, I am not changing it being activated by the X button. If only I showed you the script so you could see. You know what join.me is? Its a site letting you see my screen, what time will you be on tomorrow? I will give you the link and you will see my screen and I will show you the screen.
Offline
when gf clicked set [buttonpressed v] to [0] //This is so the button can be pressed the first time. forever if <<key [x v] pressed?> and <(buttonpressed) = [0]>> broadcast [show the experience whatevers v] set [buttonpressed v] to [1] //This stops the button from working in the future. end endComments are broken, apparently.
Last edited by videogame9 (2012-02-22 20:49:12)
Offline
imsosuperswell1 wrote:
No, I am not changing it being activated by the X button. If only I showed you the script so you could see. You know what join.me is? Its a site letting you see my screen, what time will you be on tomorrow? I will give you the link and you will see my screen and I will show you the screen.
Could you upload the project/script? I don't feel like installing new software, sorry.
Or could you explain exactly what you are trying to do? Do you want a one-time button? Cause the scripts we are giving are one-time buttons.
Offline
First of all, you need to explain it clearly.
"two THINGS (?!?!) pop up" what things? sprites? how do they give experience? if you want us to help you, you need to ask it clearly.
Don't ask 22+ and expect to get 4.
Secondly, viewers of join.me can view directly in the browser.
Third, you do realize you can just take a picture of your scripts, right?
Offline
kayybee wrote:
First of all, you need to explain it clearly.
"two THINGS (?!?!) pop up" what things? sprites? how do they give experience? if you want us to help you, you need to ask it clearly.
Don't ask 22+ and expect to get 4.
Secondly, viewers of join.me can view directly in the browser.
Third, you do realize you can just take a picture of your scripts, right?
Ah okay.
Also, basically what he's saying is the code of conduct: http://scratch.mit.edu/forums/viewtopic … 2#p1147782
Explain everything as clearly and detailed as possible.
Offline
Well guys I figured it out. I had to add the stop script to the activation script and it worked. Oh well, close it mods!
Offline