when gf clicked forever wait until <key (n) pressed?> if<(nofail)= [on]> set (nofail) to [off] if<(nofail)= [off]> set (nofail) to [on]
Offline
im trying to have it so pressing n will toggle "NoFail mode"
Offline
G0D_M0D3 wrote:
slayerrobe7 wrote:
im trying to have it so pressing n will toggle "NoFail mode"
And what would noFail mode do?
Probably give you infinite health or something
Offline
when gf clicked set [switch] to (0) forever wait until <key [n v] pressed?> if <(switch)= (1)> set [switch] to (0) else set [switch] to (1) end endDoes that help?
[scratchblocks] when gf clicked set [switch] to (0) forever wait until <key [n v] pressed?> if <(switch)= (1)> set [switch] to (0) else set [switch] to (1) end end [/scratchblocks]
Last edited by Magnie (2012-01-27 19:57:09)
Offline
awesome magnie thank you
Offline
JSO wrote:
There's an easier way to toggle a variable between 0 and 1, like so:
when gf clicked set [switch v] to (0) forever wait until <key [n v] pressed?> set [switch v] to ((1) - (switch)) end
That's pretty clever. I probably would have wasted my time with modulus xD
Offline
To prevent it from switching back immediately, you may want to include
wait until <not <(n) key pressed?>>At the bottom of the forever loop.
Last edited by Kileymeister (2012-01-28 11:29:08)
Offline
when gf clicked set [switch v] to (0) forever wait until <key [n v] pressed?> set [switch v] to ((1) - (switch)) wait until <not <(n) key pressed?>> end
Offline
I know the problem.
Pretend it's on.
I turn it off.
It checks if it's off after it's off. Then it turns on.
when gf clicked forever wait until <key [n v]pressed> if <(nofail) = [off]> set [nofail v] to [on] else set [nofail v] to [off] endEncountered two bugs while rendering the blocks.
Last edited by rdococ (2012-01-28 12:29:20)
Offline
MoreGamesNow wrote:
JSO wrote:
There's an easier way to toggle a variable between 0 and 1, like so:
when gf clicked set [switch v] to (0) forever wait until <key [n v] pressed?> set [switch v] to ((1) - (switch)) endThat's pretty clever. I probably would have wasted my time with modulus xD
I figured that out too. xP
It can actually be used to toggle between any value and 0. I used this for Snake Eyes:
set volume to ((100) - (volume))% //for the sound button
Last edited by scimonster (2012-01-28 13:51:55)
Offline
scimonster wrote:
MoreGamesNow wrote:
JSO wrote:
There's an easier way to toggle a variable between 0 and 1, like so:
when gf clicked set [switch v] to (0) forever wait until <key [n v] pressed?> set [switch v] to ((1) - (switch)) endThat's pretty clever. I probably would have wasted my time with modulus xD
I figured that out too. xP
It can actually be used to toggle between any value and 0. I used this for Snake Eyes:set volume to ((100) - (volume))% //for the sound button
It can actually be used to toggle between any two values, provided that you start on one of them and you have the correct values implemented.
I.E., between 1 and 2, start it on one of those values and do (3-value).
Last edited by Kileymeister (2012-01-28 14:03:57)
Offline
Remember to make it wait...
whengfclicked Forever Wait until (key [n v] pressed?) If <(switch) = [0]> Set (switch) to [1] Wait (0.5) secs Else Set (switch) to [0] Wait (0.5) secs End End
Last edited by KrIsMa (2012-01-29 13:15:10)
Offline
when gf clicked forever wait until <key [n v]pressed?> wait until <not <key [n v]pressed?>> if <(nofail) = [off]> set [nofail v] to [on] else set [nofail v] to [off] endJust wanted to update my script.
Offline
rdococ wrote:
when gf clicked forever wait until <key [n v]pressed?> wait until <not <key [n v]pressed?>> if <(nofail) = [off]> set [nofail v] to [on] else set [nofail v] to [off] endJust wanted to update my script.
Or you can use my script. But this is better XD
Offline
HabaDB wrote:
sound toggle how-to?
*sigh* they just posted it on the above posts. Read before you post!
I'll just post it again here:
scimonster wrote:
It can actually be used to toggle between any value and 0. I used this for Snake Eyes:
set volume to ((100) - (volume))% //for the sound button
Offline
bob6 wrote:
HabaDB wrote:
sound toggle how-to?
*sigh* they just posted it on the above posts. Read before you post!
I'll just post it again here:scimonster wrote:
It can actually be used to toggle between any value and 0. I used this for Snake Eyes:
set volume to ((100) - (volume))% //for the sound button
And the second to last please do not necropost that would be appreciated.
And this is the wrong thread to post the question under.
Last edited by KrIsMa (2012-08-22 00:12:44)
Offline