I'm trying to use strings in a table to reference children of intvalues in a folder, however, it errors, saying things like "(arrayname) is not a valid member of Folder" and I've tried so far to do things like this (some code may seem strange):
local stats = game.Players.LocalPlayer:WaitForChild("LeaderStats")
local Index = {"IntValue1", "IntValue2", "IntValue3", "IntValue4"}
local priority = {4, 2, 3, 1}
for i = 1, stats.SeperateValue.Value do
for i = 1, #priority do
if stats:WaitForChild(Index[priority[i]]).Value > 0 then
--blah blah blah
break
end
end
end
Also, just as another small question, would the "break" end every single loop, or just the one for loop it's nested inside of?

2 comments
Thanks, it works!
Your welcome!!