As mentioned in another answer, you can use os.execute () to clear the console. However, if you do not have access to this function, you may be forced to spam the console with new lines, so the user may look "empty".
However, if you can use os.execute, you should definitely use it.
for i = 1, 255 do print() end
source share