#how to i make a button toggle

1 messages · Page 1 of 1 (latest)

pulsar portal
#

I'm just trying to make it so that this code activates when i press E

last ravenBOT
#

studio** You are now Level 5! **studio

vocal galleon
#

Use userinputservice

honest stone
#

the if statement you have there at the end only runs once, and the first time placeBlocksOn is false so it doesnt run. it doesn't magically know to run again when the value changes. structure your code in a different way, such as putting it in a function. also be aware that the opposite is also true, if you set placeBlocksOn to true and then run the function that "activates" your code, setting it to false won't automagically undo whatever your code did, you need another function to turn everything off.

pulsar portal
#

maybe i should replace the if statement with a while statement