Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I select multiple elements in a table?

I have a table right here {"String 1", "String 2", "String 3", "String 4", "String 5"}

I want to select element 3 to 5...

1 answer

✓ Accepted answer
local number = 0
for _, string in pairs(yourtable) do
	number = number + 1
	if number >= 3 and number <= 5 then
		--is under 3/5 or equal to 3/5
	end
end

or

local number = 0
for _, string in pairs(yourtable) do
	number = number + 1
	if number == 3 and number == 5 then
		--is under 3 or 5
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.