Advertisement
WeltEnSTurm

Untitled

Mar 31st, 2011
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. hook = {
  2.     functions={},
  3.     Add = function(hookTo, hookName, func)
  4.         table.insert(functions,{
  5.             name = hookName,
  6.             func = func,
  7.         })
  8.     end,
  9.     Call = function(hookName, ...)
  10.         for k,v in pairs(functions) do
  11.             if v.name == hookName then
  12.                 v.func(...)
  13.             end
  14.         end
  15.     end,
  16. }
  17.  
  18. hook.Add("This is a joke!", "Joke 1",
  19.     function(cookies, morecookies)
  20.         print(cookies + morecookies)
  21.     end
  22. )
  23.  
  24. hook.Call("This is a joke!", 2, 52)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement