if math.random() > 0.5 then
This implementation will PRNG a float in the range [0, 1), and based on what number is generated, it’ll either print 1 or 2. Basically, it’ll do a coin toss and pick one to print based on what it gets.
Don’t want to come off as rude, but how much programming experience do you have? I think you might want to take a step back and go over fundamental programming concepts first before trying to create a project.
Just concerned that you might be biting off more than you can chew, since I see plenty of people with the enthusiasm to make a game, only to turn around and get stuck by simple programming problems because they think they can get good enough at Lua to program a game in a single day.
I agree that I am not like that (without being enthusiastic about doing something), but I don’t think about all the possibilities, I may even know what to do but since I don’t think about everything, it is the result of being like that.