Advertisement
maxderopnl

Modern Survival

Oct 31st, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. money = 50
  2. health = 300
  3.  
  4. local function check()
  5.    if money <= 0 then
  6.       print('You are broke')
  7.       if health <= 0 then
  8.          print('You died')
  9.       end
  10.    end
  11. end
  12.  
  13. local function eat()
  14.    print('you ate and lost 20€')
  15.    check()
  16.    money = money-20
  17.    print('you have '.. money ..' €')
  18.    health = health+40
  19. end
  20. local function fight()
  21.    print('you fought with thieves on the street,they hit you hard bro')
  22.    health = health-10
  23.    print('you now have '.. health ..' health now')
  24. end
  25.  
  26. local function work()
  27.    print('you worked and you got 55 euros')
  28.    money = money+55
  29.    print('you have '.. money ..' €')
  30. end
  31.  
  32. local function pizza()
  33.    print('you are a man trying to survive modern')
  34.    print('surroundings you can choose from actions such as eat,work and fight')
  35.  
  36.  
  37.    sys.print('I want to ')
  38.    lol = io.read()
  39.    if lol == 'eat' then
  40.       check()
  41.      
  42.       eat()
  43.       pizza()
  44.    elseif lol == 'work' then
  45.       check()
  46.      
  47.       work()
  48.       pizza()
  49.    elseif lol == 'fight' then
  50.       check()
  51.      
  52.       fight()
  53.       pizza()
  54.    end
  55. end
  56.  
  57.  
  58. pizza()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement