Advertisement
Terrah

Armor DR

Apr 1st, 2016
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local function ArmorDR(A,D)
  2.  
  3.     return A / (A + (10 * D));
  4. end
  5.  
  6. return function(msg,usr,chan)
  7.  
  8.     local parameters = {};
  9.     for number in string.gmatch(msg,"%S+") do
  10.         table.insert(parameters,number);
  11.     end
  12.  
  13.     local armor = tonumber(parameters [1]);
  14.     local hit = tonumber(parameters [2]);
  15.    
  16.     if armor==nil or hit==nil then
  17.    
  18.         print("@"..usr.." enter armor and raw phys hit");
  19.         return;
  20.     end
  21.    
  22.     print("@"..usr.." taking a "..tostring(hit).." phys hit with "..tostring(armor).." armor would reduce the hit by "..tostring(ArmorDR(armor, hit)*100).."%");
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement