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
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
stop giving misinformations mc ur giving us cancer. You don't use underscores for important variable names because it is misleading as it does not clearly show the purpose it is meant to serve in the code. So he is perfectly fine.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
You're using three dots instead of two. Two dots resemble Lua's concatenation symbol.
Also, do not post duplicate questions.