Let's say I have property that I only want to have a variable number of states. For example, let's take an elemental attribute. We've got Fire, Grass, Water, Earth, and Wind.
Would I create a separate object for this purpose which retains a value and reference table?
local Type = {}
function Type.new(input) --input is a number or string in this case.
local o = {}
local o.Value = 0;
local typeChart = {"Fire", "Grass", "Water", "Earth", "Wind"}
if input:IsA("Number") then --Don't know exactly how to determine Data Types. If you can fill me in on this, please do.
o.Value = input;
else
for i, v in pairs(typeChart)
if input == v then
o.Value = i;
break
end
end
end
function o:getString() -- Returns the String associated with o.Value in the typeChart
function o:equals(type) -- Returns true or false when comparing two Type objects
return o;
end
Or is there a simpler way of doing this?

2 comments
I'm sorry I never really learned this, but what does "next" do?
Goes to the next [key]=value pair in a table.