formethandscience11

Extra lua functions

Oct 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.15 KB | None | 0 0
  1. math.average = function ( ... )
  2.     local g = { ... }
  3.     local x = 0
  4.     for i in pairs(g) do
  5.        x = g[i] + x
  6.     end
  7.     return x/#g
  8. end
Add Comment
Please, Sign In to add comment