Advertisement
McMrARM

Gmod Javascript injection injector

Jun 7th, 2015
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript"
  2.         script-author="MrARM"
  3.         script-desc="Now skiddie friendly!!! 8)">
  4. window.addEventListener('load', function () {
  5.     if (lua && lua.Run)
  6.     {
  7.         /**
  8.          * Opens a file into the game Lua state.
  9.          * @params {String} fileName (...) Files to server into being executed.
  10.          */
  11.         lua.Run("concommand.Add('injector', function(ply,cmd,args)      \
  12.                     for i,v in pairs(args) do                               \
  13.                         local f=file.Open('lua/' .. v, 'r', 'GAME')         \
  14.                         if (!f) then return print('Error opening ' .. v) end\
  15.                         local fs=f:Read(f:Size())                           \
  16.                         f:Close()                                           \
  17.                         RunString(fs)                                       \
  18.                     end                                                     \
  19.                 end)");
  20.  
  21.         console.log('Started the file-open service, use injector [file1], ... to use.');
  22.     }
  23.     else
  24.         console.warn('Lua utilities not found.')
  25. });
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement