You could have a string of available characters, e.g.
local characters = "abcdefghijklmnopqrstuvwxyz"
You could also do a table but that’s a loooot of commas and quotes to type and it’s not really any better.
You could also abuse the fact that letters are all in a contiguous range in ASCII and use string.char or something, but that’s hacky and inflexible so probably don’t.
You can randomly pick a length n and then n times pick a random character from the set of available characters to append to a result.
Appending lots of times to get to a single result is bad™ though, so just add them to a list and use table.concat to turn a table of characters into a single string in one go.