Advertisement
Terrah

Armor Required

Apr 1st, 2016
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. local function Required(DR,D)
  2.  
  3.     return (DR * 10 * D) / (1 - DR);
  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 dr = tonumber(parameters [1]);
  14.     local hit = tonumber(parameters [2]);
  15.    
  16.     if dr==nil or hit == nil then
  17.    
  18.         print("@"..usr.." enter decimal reduction and raw phys");
  19.         return;
  20.     end
  21.    
  22.     print("@"..usr.." to reduce a "..tostring(hit).." phys hit by "..tostring(dr*100).."% you need "..tostring(Required(dr,hit)).." armor");
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement