When attempting to return it completely stops the loop

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    To make sure when I return, it will continue looping

  2. What is the issue? Include screenshots / videos if possible!
    When looping I have it where when it detects a duplicate it will return and search through the rest of the table but it stops the loop when I return

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve swapped my code countless of times

image

for i, v in pairs(TalentInfo) do
		if EqualTables(v["Requirements"], Attributes) == true then
			if table.find(Player_Talents, i) then
				warn("Playertalents " .. i)
				return
			elseif table.find(AvailableTalents, i) then
				return
			else
				table.insert(AvailableTalents, i)
			end
		end
	end

use continue as it basically just stops any further code from running but continues the loop

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.