Alure1212

Ultimate Admin

Jan 9th, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print('Admin Working!')
  2.  
  3. -- Universe Admin by supersonicfan111
  4. admins = {"Starryful", "TORNADO11191", "girlyredwoodschool5", "awesomecheezgirl1"} -- Administrators
  5. tmp = {} -- Temp Admin
  6. banned = {"BeyondTheClouds", "Thayzen", "1waffle1", "iTov"} -- Ban
  7. hardban = {"ByteDino", "DarthStrantax", "supersonicfan11"} -- BSoD Ban
  8.  
  9.  
  10. local source = script:FindFirstChild("source")
  11. if source ~= nil then
  12. sbbu = script.source:clone()
  13. sbbu.Disabled = false
  14. else
  15. print("Source doesn't exist, some commands won't work")
  16. end
  17.  
  18. -- Settings
  19. local bet = ";"
  20. local version = "1"
  21. local gamepass = false
  22. local GamePassService = Game:GetService('GamePassService')
  23. local PlayersService = Game:GetService('Players')
  24. local InsertService = Game:GetService('InsertService')
  25.  
  26. -- Gamepass Object
  27. local GamePassIdObject = WaitForChild(script, 'GamePassId')
  28.  
  29. -- Give admin to player with gamepass
  30. local function OnPlayerAdded(player)
  31. if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
  32. table.insert(admins, player.Name)
  33. end
  34. end
  35.  
  36.  
  37. -- FindPlayer
  38. function findplayer(name,speaker)
  39. if string.lower(name) == "all" then
  40. local chars = { }
  41. local c = game.Players:GetChildren()
  42. for i =1,#c do
  43. if c[i].className == "Player" then
  44. table.insert(chars,c[i])
  45. end end
  46. return chars
  47. elseif string.sub(string.lower(name),1,9) == "nonadmins" then
  48. local nnum = 0
  49. local chars = { }
  50. local c = game.Players:GetChildren()
  51. for i=1,#c do
  52. local isadmin = false
  53. for i2 =1,#namelist do
  54. if namelist[i2] == c[i].Name then
  55. isadmin = true
  56. end end
  57. if isadmin == false then
  58. nnum = nnum + 1
  59. table.insert(chars,c[i])
  60. end end
  61. if nnum == 0 then
  62. return 0
  63. else
  64. return chars
  65. end
  66. elseif string.sub(string.lower(name),1,6) == "admins" then
  67. local anum = 0
  68. local chars = { }
  69. local c = game.Players:GetChildren()
  70. for i=1,#c do
  71. for i2 =1,#namelist do
  72. if namelist[i2] == c[i].Name then
  73. anum = anum + 1
  74. table.insert(chars,c[i])
  75. end end end
  76. if anum == 0 then
  77. return 0
  78. else
  79. return chars
  80. end
  81. elseif string.sub(string.lower(name),1,6) == "random" then
  82. while true do
  83. local c = game.Players:GetChildren()
  84. local r = math.random(1,#c)
  85. if c[r].className == "Player" then
  86. return { c[r] }
  87. end end
  88. elseif string.sub(string.lower(name),1,6) == "guests" then
  89. local gnum = 0
  90. local chars = { }
  91. local c = game.Players:GetChildren()
  92. for i=1,#c do
  93. if string.sub(c[i].Name,1,5) == "Guest" then
  94. gnum = gnum + 1
  95. table.insert(chars,c[i])
  96. end end
  97. if gnum == 0 then
  98. return 0
  99. else
  100. return chars
  101. end
  102. elseif string.sub(string.lower(name),1,5) == "team " then
  103. local theteam = nil
  104. local tnum = 0
  105. if game.Teams ~= nil then
  106. local c = game.Teams:GetChildren()
  107. for i =1,#c do
  108. if c[i].className == "Team" then
  109. if string.find(string.lower(c[i].Name),string.sub(string.lower(name),6)) == 1 then
  110. theteam = c[i]
  111. tnum = tnum + 1
  112. end end end
  113. if tnum == 1 then
  114. local chars = { }
  115. local c = game.Players:GetChildren()
  116. for i =1,#c do
  117. if c[i].className == "Player" then
  118. if c[i].TeamColor == theteam.TeamColor then
  119. table.insert(chars,c[i])
  120. end end end
  121. return chars
  122. end end
  123. return 0
  124. elseif string.lower(name) == "me" then
  125. local person299 = { speaker }
  126. return person299
  127. elseif string.lower(name) == "others" then
  128. local chars = { }
  129. local c = game.Players:GetChildren()
  130. for i =1,#c do
  131. if c[i].className == "Player" then
  132. if c[i] ~= speaker then
  133. table.insert(chars,c[i])
  134. end end end
  135. return chars
  136. else
  137. local chars = { }
  138. local commalist = { }
  139. local ssn = 0
  140. local lownum = 1
  141. local highestnum = 1
  142. local foundone = false
  143. while true do
  144. ssn = ssn + 1
  145. if string.sub(name,ssn,ssn) == "" then
  146. table.insert(commalist,lownum)
  147. table.insert(commalist,ssn - 1)
  148. highestnum = ssn - 1
  149. break
  150. end
  151. if string.sub(name,ssn,ssn) == "," then
  152. foundone = true
  153. table.insert(commalist,lownum)
  154. table.insert(commalist,ssn)
  155. lownum = ssn + 1
  156. end end
  157. if foundone == true then
  158. for ack=1,#commalist,2 do
  159. local cnum = 0
  160. local char = nil
  161. local c = game.Players:GetChildren()
  162. for i =1,#c do
  163. if c[i].className == "Player" then
  164. if string.find(string.lower(c[i].Name),string.sub(string.lower(name),commalist[ack],commalist[ack + 1] - 1)) == 1 then
  165. char = c[i]
  166. cnum = cnum + 1
  167. end end end
  168. if cnum == 1 then
  169. table.insert(chars,char)
  170. end end
  171. if #chars ~= 0 then
  172. return chars
  173. else
  174. return 0
  175. end
  176. else
  177. local cnum = 0
  178. local char = nil
  179. local c = game.Players:GetChildren()
  180. for i =1,#c do
  181. if c[i].className == "Player" then
  182. if string.find(string.lower(c[i].Name),string.lower(name)) == 1 then
  183. char = {c[i]}
  184. cnum = cnum + 1
  185. end end end
  186. if cnum == 1 then
  187. return char
  188. elseif cnum == 0 then
  189. text("That name is not found.",1,"Message",speaker)
  190. return 0
  191. elseif cnum > 1 then
  192. text("That name is ambiguous.",1,"Message",speaker)
  193. return 0
  194. end end end end
  195.  
  196. function createscript(source,par)
  197. local a = sbbu:clone()
  198. local context = Instance.new("StringValue")
  199. context.Name = "Context"
  200. context.Value = source
  201. context.Parent = a
  202. while context.Value ~= source do wait() end
  203. a.Parent = par
  204. local b = Instance.new("IntValue")
  205. b.Name = "Is A Created Script"
  206. b.Parent = a
  207. end
  208.  
  209. function text(message,duration,type,object)
  210. local m = Instance.new(type)
  211. m.Text = message
  212. m.Parent = object
  213. wait(duration)
  214. if m.Parent ~= nil then
  215. m:remove()
  216. end end
  217.  
  218. function foc(msg,speaker)
  219. if string.lower(msg) == "fix" then
  220. for i =1,#namelist do
  221. if namelist[i] == speaker.Name then
  222. variablelist[i]:disconnect()
  223. table.remove(variablelist,i)
  224. table.remove(namelist,i)
  225. table.remove(flist,i)
  226. end end
  227. local tfv = speaker.Chatted:connect(function(msg) oc(msg,speaker) end)
  228. table.insert(namelist,speaker.Name)
  229. table.insert(variablelist,tfv)
  230. local tfv = speaker.Chatted:connect(function(msg) foc(msg,speaker) end)
  231. table.insert(flist,tfv)
  232. end end
  233.  
  234. function PERSON299(name)
  235. for i =1,#adminlist do
  236. if adminlist[i] == name then
  237. return true
  238. end end
  239. return false
  240. end
  241.  
  242. function oc(msg,speaker)
  243.     if string.sub(string.lower(msg),1,2) == "m"..bet then
  244. text(speaker.Name .. ": " .. string.sub(msg,3),2,"Message",game.Workspace)
  245.     end
  246.     if string.sub(string.lower(msg),1,3) == "sm"..bet then
  247.         text("System Message: ".. string.sub(msg,4),2,"Message",game.Workspace)
  248.     end
  249.     if string.sub(msg,1,4) == "ban"..bet then
  250. local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name)
  251. if imgettingtiredofmakingthisstupidscript2 == true then
  252. local player = findplayer(string.sub(msg,5),speaker)
  253. if player ~= 0 then
  254. for i = 1,#player do
  255. local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name)
  256. if imgettingtiredofmakingthisstupidscript == false then
  257. if player[i].Name ~= eloname then
  258. table.insert(banned,player[i].Name)
  259. player[i]:remove()
  260. end end end end end end
  261.     if string.sub(msg,1,5) == "nilc"..bet then
  262.         for _, v in pairs(game:service("NetworkServer"):GetChildren()) do
  263. if v:GetPlayer().Parent == nil then
  264. v:GetPlayer():Kick()
  265. end
  266. end
  267.     end
  268. if string.sub(string.lower(msg),1,5) == "kill"..bet then
  269. local player = findplayer(string.sub(msg,6),speaker)
  270. if player ~= 0 then
  271. for i = 1,#player do
  272. if player[i].Character ~= nil then
  273. player.Character:BreakJoints()
  274. end end end end
  275. if string.sub(string.lower(msg),1,7) == "noclip"..bet then
  276.     local player = findplayer(string.sub(msg,8),speaker)
  277.     if player ~= 0 then
  278.         for i = 1,#player do
  279.             if player[i].Backpack ~= nil then
  280.             script.Noclip:Clone().Parent = player.Backpack
  281. end end end end
  282. if string.sub(string.lower(msg),1,5) == "clip"..bet then
  283.     local player = findplayer(string.sub(msg,6),speaker)
  284.         if player ~= 0 then
  285.         for i = 1,#player do
  286.             if player[i].Backpack ~= nil then
  287.                 if player[i].Character ~= nil then
  288.                 player.Backpack.Noclip:remove()
  289.                 player.Character.Torso.Anchored = false
  290.                 wait(.1) player.Character.Humanoid.PlatformStand = false
  291. end end end end end
  292. if string.sub(string.lower(msg),1,6) == "crash"..bet then
  293.     local player = findplayer(string.sub(msg,7),speaker)
  294.         if player ~= 0 then
  295.         for i = 1,#player do
  296.             if player[i].Backpack ~= nil then
  297.                 script.Crash:Clone().Parent = player.Backpack
  298.             end end end end
  299. end
Add Comment
Please, Sign In to add comment