So I’m looping through children of a frame, then looping through frames in that frame. But right now I’m trying to make the script only loop through the frames inside the parent frame, but what I’m doing isn’t working and it loops through all the children of the frame anyway. You can also ignore all the table stuff, that’s for a datastore
while wait(15) do
for i, player in pairs(game.Players:GetPlayers()) do
local Settings = {}
for i, v in pairs(player.PlayerGui.ScreenUI.Settings.BigScroll.RescaleFrame:GetChildren()) do
if v:IsA("Frame") and v.Name ~= "Description" then -- This is the line that's not working correctly.
for i, object in pairs(v:GetChildren()) do
local Setting = {}
Setting["Name"] = v.Name
if object.YesNo.Image == "http://www.roblox.com/asset/?id=6302778252" then
Setting["Check"] = false
else
Setting["Check"] = true
end
Setting["SettingType"] = object.Parent.Name
end
end
end
local json = HttpService:JSONEncode(Settings)
SettingData:SetAsync(player.UserId, json)
end
end
This wouldn’t work because of how Lua handles the order of logical operations. Instead, it should be if not (v.Name == 'Description') then
or if v.Name ~= 'Description' then
(Which was what he used)
for i, v in pairs(player.PlayerGui.ScreenUI.Settings.BigScroll.RescaleFrame:GetChildren()) do
if v:IsA("Frame") and v.Name ~= "Description" then -- This is the line that's not working correctly.
for i, object in pairs(v:GetChildren()) do
if v:IsA("Frame") then