v3 · Activity 6 of 8 · execution-order · state-updates · 2 min Runs here
The first print reads coins before the update. The second print reads it after the update. That is why the two outputs differ.
Run this local variable example. Display its stored value before and after updating it with addition: 10, then 15.
10 15
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local score=2
print(score)
score=score+4
print(score)Output shows the starting 2 and then the updated 6.
This activity reuses syntax you have already met.
A print shows the value at the moment that instruction runs. It does not change when a later instruction updates the variable.
This number exists only inside this run. The browser has not created a real persistent Roblox currency.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
10
5
This is a private experiment copy. It does not replace your answer or complete the activity.
Your output will appear here.
Replace this code with the starter? Download your draft to keep a copy.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.