Any way to make this more efficient?

if Detection == false then
					PageDisplay.Text = "Page " .. Page - 1 .. "/" .. Max
				elseif Detection == true then
					PageDisplay.Text = "Page " .. Page + 1 .. "/" .. Max
				end

obviously you can see the only difference is the operation, is there any way i can make it efficient?

1 Like

ig you can just remove the if statement for a ternary like this:

	PageDisplay.Text = "Page " ..(Detection and Page + 1 or Page -1) .. "/" .. Max
2 Likes

This looks like it would work, thanks.

1 Like