How would I make a sequence? (For example, whenever the function activates, it'll cycle through each variable, returning to the original.) Is this even possible?
function Colors() local a = NumberSequence.new(1, 3) if a == 1 then print'one' end if a == 2 then print'two' end if a == 3 then print'three' end end
Use a for loop:
local NS = {1, 2, 3} function Colors() for i = 1,#NumberSeq do -- Using a for loop goes through each number by one unless changed if i == 1 then print('one') elseif i == 2 then -- elseif goes through that if only for each loop print('two') elseif i == 3 then print('three') end end end event:connect(Colors) -- change the event to the event that should call the function