The locals are there in the original script its the 3rd line that is not working. for _ = 1,5 do
stats.Views.Value = stats.Views.Value + 1
script.Parent.Parent.Parent.Parent.pot.Text = "Views:".. 1 + i
wait(1)
end
Did you copy paste this without knowing what it does? The “i” variable commonly seen in loops isn’t magic, it is specified at the beginning, where you used an underscore instead. An underscore is commonly used as a “garbage variable” when we aren’t going to use the value, but that is not the case here! Fixed code:
for i = 1,5 do stats.Views.Value = stats.Views.Value + 1 script.Parent.Parent.Parent.Parent.pot.Text = "Views:" .. 1 + i wait(1) end
Also maybe you’re typing this on a phone and not copy pasting directly but that was an ellipsis character between "Views:"
and 1 + i
there, where it should be two dots (..
).
[Edit] I just saw your other question, you should use my code above, but adding an increment to i
would also work with yours:
local i = 1 for i = 1,5 do stats.Views.Value = stats.Views.Value + 1 script.Parent.Parent.Parent.Parent.pot.Text = "Views:" .. 1 + i wait(1) i = i + 1 end
Marked as Duplicate by DeceptiveCaster, namespace25, Fifkee, and popeeyy
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?