Fun thing to convert to a addon


print("* Guess a Number Game *")math.randomseed( os.time() )
repeat
   Trial = 1
   Number = math.random(100)
   print("Guess a Number 1-100")
   while true do
      print("Trial " .. Trial .. "?")
      Guess = io.read("*n")
      -- check end
      if Guess == Number then
         print("Correct")
         print("You Won!")
         break
      elseif Trial == 10 then
         print("You Lose!")
         print("The Number is "..Number)
         break
      end
      -- give hint
      if Guess < Number then
         print("Wrong")
         print("Try Larger Number")
      elseif Guess > Number then
         print("Wrong")
         print("Try Smaller Number")
      end
      Trial = Trial + 1
   end
   print("Do you want to Play again (y/n)?")
   more = io.read()
until more ~= "y"


print("Goodbye!")




Guess a random number game! You could probably use this as some sort of lottery on any gamemode or whatever you want to do with it. Good luck! You must put this into gmod format yourself or inside your gamemode.

I just don’t really see anyone using this :3