Advertisement
Prior_

Untitled

Oct 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. PRegiments = {}
  2.  
  3. if SERVER then
  4.  
  5. include("pregiments/configuration/sh_configuration.lua")
  6. AddCSLuaFile("pregiments/configuration/sh_configuration.lua")
  7.  
  8. local fileTable = {
  9. ["cl_"] = {_G["AddCSLuaFile"]},
  10. ["sv_"] = {_G["include"]},
  11. ["sh_"] = {_G["include"], _G["AddCSLuaFile"]}
  12. }
  13.  
  14. for index, folder in pairs(select(2, file.Find("pregiments/*", "LUA"))) do
  15. if folder == "configuration" then continue end
  16. for _, luaFile in pairs(select(1, file.Find("pregiments/"..folder.."/*", "LUA"))) do
  17. for prefix, addTable in pairs(fileTable) do
  18. if prefix != string.sub(luaFile, 0, 3) then continue end
  19. for j, addFunc in pairs(addTable) do
  20. local luaFile = "pregiments/"..folder.."/"..luaFile
  21. addFunc(luaFile)
  22. end
  23. end
  24. end
  25. end
  26.  
  27. end
  28.  
  29. if CLIENT then
  30.  
  31. include("pregiments/configuration/sh_configuration.lua")
  32.  
  33. local fileTable = {
  34. ["cl_"] = {_G["include"]},
  35. ["sh_"] = {_G["include"]}
  36. }
  37.  
  38. for index, folder in pairs(select(2, file.Find("pregiments/*", "LUA"))) do
  39. if folder == "configuration" then continue end
  40. for _, luaFile in pairs(select(1, file.Find("pregiments/"..folder.."/*", "LUA"))) do
  41. for prefix, addTable in pairs(fileTable) do
  42. if prefix != string.sub(luaFile, 0, 3) then continue end
  43. for j, addFunc in pairs(addTable) do
  44. local luaFile = "pregiments/"..folder.."/"..luaFile
  45. addFunc(luaFile)
  46. end
  47. end
  48. end
  49. end
  50.  
  51. end
  52.  
  53.  
  54. print("Poseidon Regiments Successfully Loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement