local comMod= script.Parent:WaitForChild('ModuleScript'); local background = comMod.WaitForChild(script.Parent, 'background'); local main = comMod.WaitForChild(script.Parent.Parent, 'Main'); local questButton = comMod.WaitForChild(background, 'quests'); local questFrame = comMod.WaitForChild(main, 'questFrame'); local challengeFolder = comMod.WaitForChild(main, 'Challenges'); local challenges = {}; ---// variables am i rite function insertChallenge(challenge) print('adding '..challenge..' to the Challenges Table!'); local amount = #challenges table.insert(challenges, (amount+1), challenge) print(challenges[amount+1]); return challenges[amount+1]; end function removeChallenge(number) table.remove(challenges, number) return true; end function updateChallenges() for i = 1,#challengeFolder:GetChildren() do wait(); local name = challengeFolder:GetChildren()[i].Name print(challenges[i]); if challenges[i] == name then print(name..' is already in the Challenge Table!'); return true; elseif challenges[i] ~= name then print(name..' does not exist in the Challenge Table, adding it now!'); insertChallenge(name); return challenges.name; end end end questButton.MouseButton1Click:connect(function() script.Disabled = true; updateChallenges(); questFrame.Visible = not questFrame.Visible script.Disabled = false; end)
So, for some reason in the 3rd function, updateChallenges(), whenver I check to see if the challenge is already in the table, it will not read it and say it is not in the table?