Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » A button doing something else when you click it again.
- CraySilver
-
59 posts
A button doing something else when you click it again.
I need help with button code I wanna make it so if you press “E” It shows something but when you press “E” again it hides it please help.
Last edited by CraySilver (Feb. 11, 2022 20:30:13)
yop
when green flag clicked
forever
say [let coding]
end
- gor-dee
-
1000+ posts
A button doing something else when you click it again.
maybe
when this sprite clicked
if <(foo) = [true]> then
set [foo v] to [false]
show
else
set [foo v] to [true]
hide
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
let me try
yop
when green flag clicked
forever
say [let coding]
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
i think my computer broke when i put it ![](//cdn.scratch.mit.edu/scratchr2/static/__c2809c1107e2c2715f0ec5750c3512f7__/djangobb_forum/img/smilies/sad.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__c2809c1107e2c2715f0ec5750c3512f7__/djangobb_forum/img/smilies/sad.png)
Last edited by CraySilver (Feb. 12, 2022 06:08:31)
yop
when green flag clicked
forever
say [let coding]
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
cause im on a chrome book and i drop my chrome book multiple times and ever since i dropped it, it doesnt load fast
yop
when green flag clicked
forever
say [let coding]
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
nevermind its just the code it doesnt work
yop
when green flag clicked
forever
say [let coding]
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
maybe i should use hidden costumes???
yop
when green flag clicked
forever
say [let coding]
end
- CraySilver
-
59 posts
A button doing something else when you click it again.
nope costumes dont work
yop
when green flag clicked
forever
say [let coding]
end
- bookmanoldstyle
-
33 posts
A button doing something else when you click it again.
when green flag clicked
switch costume to [apple]
set [e pressed?] to [0]
when [e] key pressed
if <e pressed? = 1> then
set [e pressed?] to [1]
switch costume to [apple]
play sound [Sorry, already pressed] until done
else
set [e pressed?] to [1]
switch costume to [banana]
play sound [Pressed it!] until done
end
Try this! I think it'll help. I've also made another version- https://turbowarp.org/643237609. I think it should work.
Nooooo! I saved my signature, and it's GONE!
- bookmanoldstyle
-
33 posts
A button doing something else when you click it again.
maybewhen this sprite clicked
if <(foo) = [true]> then
set [foo v] to [false]
show
else
set [foo v] to [true]
hide
end
I think this'll work, too.
Nooooo! I saved my signature, and it's GONE!
- Discussion Forums
- » Help with Scripts
-
» A button doing something else when you click it again.