Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- health=200
- mana=1000
- money=0
- local function game()
- local function fight()
- loss = math.random(200)
- print('you fought with a Dwarf and lost '.. loss ..' health')
- health=loss
- game()
- end
- local function fullmana()
- print('you drank a full mana')
- mana=1000
- game()
- end
- local function fullhealth()
- print('you drank a full health')
- health=200
- game()
- end
- local function eat()
- if health == 200 then
- print('max health!')
- else
- print('you ate and restored 17 health')
- game()
- end
- end
- local function rest()
- print('you are resting, please wait 5 seconds')
- sys.sleep(5000)
- print('your mana has been restored')
- mana=1000
- game()
- end
- local function shop()
- print('you searched for a merchant and found one!')
- print('items you can buy:')
- print('1. full mana Û250')
- print('2. full health Û500')
- print('3. nothing')
- print('what do you want to buy? type the number in front of the item')
- buying = io.read()
- if buying == '1' then
- fullmana()
- elseif buying == '2' then
- fullhealth()
- elseif buying == '3' then
- game()
- end
- end
- sys.print('I want to ')
- input = io.read()
- if input == 'eat' then
- eat()
- elseif input == 'store' then
- shop()
- elseif input == 'fight' then
- fight()
- elseif input == 'rest' then
- rest()
- end
- end
- game()
Advertisement
Add Comment
Please, Sign In to add comment