Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » i need something where if a variable updates it does a set script
- Behinding
-
New Scratcher
4 posts
i need something where if a variable updates it does a set script
its complicated but i just need this for something I'm working on
- deck26
-
Scratcher
1000+ posts
i need something where if a variable updates it does a set script
Store the value in a different variable and wait until they don't match. Then set the second variable to the new value and run your code. Add a loop around that.
- Top99hop
-
Scratcher
14 posts
i need something where if a variable updates it does a set script
run a cluster with var
- MarioManX
-
Scratcher
7 posts
i need something where if a variable updates it does a set script
In a forever loop,
1. Store your variable in a temporary variable.
2. check if the variable does not equal the temporary variable, if it does not, run the custom block with your set script.
This will loop every frame, checking for updates.
1. Store your variable in a temporary variable.
2. check if the variable does not equal the temporary variable, if it does not, run the custom block with your set script.
This will loop every frame, checking for updates.
Last edited by MarioManX (Dec. 22, 2025 15:21:53)
- Behinding
-
New Scratcher
4 posts
i need something where if a variable updates it does a set script
In a forever loop,can I have a visual on this
1. Store your variable in a temporary variable.
2. check if the variable does not equal the temporary variable, if it does not, run the custom block with your set script.
This will loop every frame, checking for updates.
- MarioManX
-
Scratcher
7 posts
i need something where if a variable updates it does a set script
forever
set [stored value v] to (variable)
if <not <[stored value] = [variable]>> then
end
- MarioManX
-
Scratcher
7 posts
i need something where if a variable updates it does a set script
For some reason the variable blocks didn’t show up. Just put whatever scripts you want inside the if check. Let me know if this helps. 

- The_Cool_Test_Alt
-
Scratcher
100+ posts
i need something where if a variable updates it does a set script
forever
set [stored value v] to (variable)
if <not <(stored value) = (variable)>> then
end
It should be a wait until, not an if.
For some reason the variable blocks didn’t show up.
As a general rule of thumb with scratchblocks:
- [x] shows up as a text field that says “x”
- (x) shows up as a reporter or a variable named “x”
- [x v] shows up as a rectangular drop-down menu with the label “x” being shown
- (x v) shows up as a round drop-down menu with the label “x” being shown
- Discussion Forums
- » Help with Scripts
-
» i need something where if a variable updates it does a set script