Making loop loop its self without an extra loop

Basically Im trying to make a system that loops around a table 3 times in a row. and I was wondering if their was an easier way of doing this without an extra loop.

I would also need to get the player out of a table when its their turn

I tried to use this but this didn’t work:

for i=1,speakerAmount*3 do
	local player = speakerTable[i%3]
end
1 Like
local speakerAmount = 3

for i = 1, speakerAmount*3 do
	local _, remainder = math.modf(i*0.33)
	local number = math.ceil(remainder*3)
	local player = speakerTable[number]
end

Thank you! Never knew math.modf was a thing

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