# Dex calc.lua

Mar 28th, 2021 (edited)
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. function getDefense()
2.   write("What is your dex? ")
4.   local numDex = tonumber(dex)
5.   local defense = numDex * 3.6
6.   local passiveDefense = defense * 0.348
7.   print("Dex: "..numDex)
8.   print("Defense: "..defense)
9.   print("Passive Defense: "..passiveDefense)
10. end
11.
12. function getDexByDefense()
13.   write("What is your defense? ")
15.   local numDefense = tonumber(defense)
16.   local dex = numDefense / 3.6
17.   local passiveDefense = numDefense * 0.348
18.   print("Dex: "..dex)
19.   print("Defense: "..numDefense)
20.   print("Passive Defense: "..passiveDefense)
21. end
22.
23. function getDexByPDef()
24.   write("What is your passive defense? ")
26.   local numPassiveDefense = tonumber(passiveDefense)
27.   local defense = numPassiveDefense / 0.348
28.   local dex = defense / 3.6
29.   print("Dex: "..dex)
30.   print("Defense: "..defense)
31.   print("Passive Defense: "..numPassiveDefense)
32. end
33.
34. print("What are you calculating?\n1. Get Defense by Dex\n2. Get Dex by Defense\n3. Get Dex by Passive Defense")
35. write("Enter option: ")