Advertisement
Ilkailka

Roblox admin

Apr 24th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.06 KB | None | 0 0
  1.  
  2. local Owner = "TOP_SECRE"
  3. local Admins = {}
  4. local Banned = {}
  5. local Prefix = ':'
  6.  
  7.  
  8. local Commands = {'music - Play a song.';
  9. 'play - Play a song from the pre-installed music';
  10. 'listmusic - List all pre-installed music';
  11. 'cls - Clears the board.';
  12. 'spawn - Respawn a person';
  13. 'bsod (REQUIRES SU ACCESS), Crash a person';
  14. 'nbsod (REQUIRES SU ACCESS) Crash a person while they are nil';
  15. 'echo - Output something on the console';
  16. 'setadmin (REQUIRES SU ACCESS) - Sets a persons admin rights';
  17. 'deladmin (REQUIRES SU ACCESS) - Delete a persons admin rights';
  18. 'clearadmin (REQUIRES SU ACCESS) - Clears the admin list.';
  19. 'su - Request SU access.';
  20. 'setsu (REQUIRES SU ACCESS) - Gives a person Super User access';
  21. 'clearsu (REQUIRES SU ACCESS) - Clears the SU list';
  22. 'checksu - Check your personal SU access';
  23. 'locksu (REQUIRES SU ACCESS) - Stops anyone from joining SU by saying su';
  24. 'exe - Execute a script';
  25. 'h - load a script through HTTP';
  26. 'ban - Ban a person.';
  27. }
  28.  
  29. local Sounds = {
  30. {Name='Angel with a shotgun',ID=181674510},
  31. {Name="Booty had me like",ID=177348122},
  32. {Name="Turn down for what", ID=143959455},
  33. {Name="Mako, Beam", ID=165065112},
  34. }
  35.  
  36. local http = game:GetService('HttpService')
  37.  
  38. local Console = Instance.new('Part',game.Workspace)
  39. Console.FormFactor = Enum.FormFactor.Custom
  40. Console.Anchored = true
  41. Console.CanCollide = false
  42. Console.Locked = true
  43. Console.Name = "MainConsole"
  44.  
  45. Console.Transparency = .6
  46.  
  47. Console.BrickColor = BrickColor.new(Color3.new())
  48.  
  49. Console.Size = Vector3.new(22, 25, .1)
  50.  
  51. local SurfaceGui = Instance.new('SurfaceGui',Console)
  52.  
  53. local SULocked = false
  54. local SuperUser = {} -- Leave this empty.
  55. table.insert(SuperUser, Owner)
  56.  
  57. function MakeSFrame(Parent, Name, BorderSizePixel, Size, Position, BackgroundColor, BackgroundTransparency, ZIndex)
  58. local Frame = Instance.new("Frame", Parent)
  59. Frame.Name = Name
  60. Frame.BackgroundTransparency = BackgroundTransparency
  61. Frame.BorderSizePixel = BorderSizePixel
  62. Frame.Size = Size
  63. Frame.Position = Position
  64. Frame.BackgroundColor = BackgroundColor
  65. Frame.ZIndex = ZIndex
  66. return Frame
  67. end
  68.  
  69. function showMsg(Text)
  70. local MSG = Instance.new("TextLabel", Console.SurfaceGui)
  71. MSG.Position=UDim2.new(0, 0, -1.5, 0)
  72. MSG:TweenPosition(UDim2.new(0,0,0,0))
  73. MSG.BackgroundColor = BrickColor.new('Really black')
  74. MSG.BackgroundTransparency = 0
  75. MSG.TextScaled = true
  76. MSG.BorderSizePixel = 0
  77. MSG.Size = UDim2.new(1, 0, 1, 0)
  78. MSG.TextColor = BrickColor.new('White')
  79. MSG.ZIndex = 10
  80. MSG.Text = Text
  81. MSG.Font = 'ArialBold'
  82. MSG.FontSize=Enum.FontSize.Size48
  83. MSG:TweenPosition(UDim2.new(0, 0, 0, 0))
  84. coroutine.resume(coroutine.create(function()
  85. wait(2)
  86. MSG:TweenPosition(UDim2.new(0, 0, 1.5, 0))
  87. repeat wait() until MSG.Position == UDim2.new(0, 0, 1.5, 0)
  88. MSG:Remove()
  89. end))
  90. end
  91.  
  92. function MakeTextLabel(Parent, Name, BorderSizePixel, Size, Position, ZIndex, Text,TextColor)
  93. local Lbl = Instance.new("TextLabel", Parent)
  94. Lbl.Name=Name
  95. Lbl.BackgroundTransparency=.6
  96. Lbl.TextScaled = true
  97. Lbl.BorderSizePixel = BorderSizePixel
  98. Lbl.BackgroundColor = BrickColor.new'Really black'
  99. Lbl.Size = Size
  100. Lbl.Position = Position
  101. Lbl.TextColor=TextColor
  102. Lbl.ZIndex = ZIndex
  103. Lbl.Text = Text
  104. Lbl.Font ='ArialBold'
  105. Lbl.FontSize=Enum.FontSize.Size36
  106. return Lbl
  107. end
  108.  
  109. local OutputFrame = MakeSFrame(SurfaceGui, 'Output', 0, UDim2.new(.99, 0, .94, 0), UDim2.new(.005, 0, .055, 0), BrickColor.new'Really black', .6, 1)
  110.  
  111. function Output(Text)
  112. if #OutputFrame:GetChildren() == 20 then
  113. OutputFrame:ClearAllChildren()
  114. end
  115. for _,v in pairs(OutputFrame:GetChildren()) do
  116. v.Position = (v.Position + UDim2.new(0, 0, .05, 0))
  117. end
  118. local Lbl = Instance.new("TextLabel", OutputFrame)
  119. Lbl.Name = "Output"
  120. Lbl.BackgroundTransparency=1
  121. Lbl.TextScaled = true
  122. Lbl.Size = UDim2.new(1, 0, .05, 0)
  123. Lbl.Position = UDim2.new(0, 0, 0, 0)
  124. Lbl.TextColor=BrickColor.new'White'
  125. Lbl.ZIndex = 1
  126. -- Lbl.Font ='ArialBold'
  127. Lbl.FontSize=Enum.FontSize.Size36
  128. Lbl.TextXAlignment = "Left"
  129. for i=1,#Text do
  130. wait()
  131. Lbl.Text = Text:sub(1,i)..('_')
  132. end
  133. Lbl.Text = Text
  134. return Lbl
  135. end
  136.  
  137. function Error(Text)
  138. if #OutputFrame:GetChildren() == 20 then
  139. OutputFrame:ClearAllChildren()
  140. end
  141. for _,v in pairs(OutputFrame:GetChildren()) do
  142. v.Position = (v.Position + UDim2.new(0, 0, .05, 0))
  143. end
  144. local Lbl = Instance.new("TextLabel", OutputFrame)
  145. Lbl.Name = "Output"
  146. Lbl.BackgroundTransparency=1
  147. Lbl.TextScaled = true
  148. Lbl.Size = UDim2.new(1, 0, .05, 0)
  149. Lbl.Position = UDim2.new(0, 0, 0, 0)
  150. Lbl.TextColor=BrickColor.new(Color3.new(200, 0, 0))
  151. Lbl.ZIndex = 1
  152. Lbl.Text = Text
  153. Lbl.Font ='ArialBold'
  154. Lbl.FontSize=Enum.FontSize.Size36
  155. Lbl.TextXAlignment = "Left"
  156. return Lbl
  157. end
  158.  
  159. MakeTextLabel(SurfaceGui, 'Title', 0, UDim2.new(.99, 0, .05, 0), UDim2.new(.005,0,.005,0), 1, 'Console', BrickColor.new'White')
  160.  
  161. function getPlayer(name)
  162. local l = string.len(name)
  163. for _,v in pairs(game.Players:GetChildren()) do
  164. if string.sub(v.Name:lower(),1,l) == name:lower() then
  165. return v
  166. end
  167. end
  168. return nil
  169. end
  170.  
  171. function onChatted(rlmsg, speaker)
  172. local hasSu = false
  173. for _,v in pairs(SuperUser) do
  174. if v:lower() == speaker.Name:lower() then
  175. hasSu = true
  176. end
  177. end
  178. msg = rlmsg:lower()
  179. if msg:sub(1,#Prefix) == Prefix or msg:sub(1,3+#Prefix) == '/e '..Prefix then
  180. if msg:sub(1, #Prefix) == Prefix then
  181. msg=msg:sub(1+#Prefix)
  182. rlmsg=rlmsg:sub(1+#Prefix)
  183. print(msg)
  184. elseif msg:sub(1,3) == '/e ' then
  185. msg=msg:sub(string.len('/e ')+1+#Prefix)
  186. rlmsg=rlmsg:sub(string.len('/e ')+1+#Prefix)
  187. print(msg)
  188. end
  189. if msg == 'su' and not SULocked then
  190. local hasSu = false
  191. for i=1,#SuperUser do
  192. if SuperUser[i]:lower() == speaker.Name:lower() then
  193. hasSu = true
  194. Output(speaker.Name.." is removed from the superuser list")
  195. table.remove(SuperUser, i)
  196. end
  197. end
  198. if not hasSu then
  199. table.insert(SuperUser, speaker.Name)
  200. Output('Granted super user access to '..speaker.Name)
  201. end
  202. elseif msg == 'locksu' and hasSu then
  203. if not SULocked then
  204. SULocked = true
  205. Output'SU list locked'
  206. elseif SULocked then
  207. SULocked = false
  208. Output'SU list unlocked'
  209. end
  210. elseif msg == 'clearsu' and hasSu then
  211. for i=1,#SuperUser do
  212. Output(SuperUser[i]..' removed from list')
  213. table.remove(SuperUser, i)
  214. end
  215. Output'SU List cleared.'
  216. table.insert(SuperUser, Owner)
  217. elseif msg == 'checksu' then
  218. if hasSu then
  219. Output(speaker.Name..' has super user access')
  220. elseif not hasSu then
  221. Output(speaker.Name..' doesnt have super user access.')
  222. end
  223. elseif msg == "cls" then
  224. OutputFrame:ClearAllChildren()
  225. elseif msg:sub(1,5) == 'echo ' then
  226. if msg:sub(#msg) ~= "." then
  227. Output(speaker.Name.."$echo: "..msg:sub(6,6):upper()..msg:sub(7)..'.')
  228. else
  229. Output(speaker.Name.."$echo: "..msg:sub(6,6):upper()..msg:sub(7))
  230. end
  231. elseif msg:sub(1,9) == 'setadmin ' and hasSu then
  232. if getPlayer(msg:sub(10)) ~= nil and getPlayer(msg:sub(10)).Name ~= Owner then
  233. for i=1,#Admins do
  234. if Admins[i] == getPlayer(msg:sub(10)) then
  235. table.remove(Admins, i)
  236. end
  237. end
  238. table.insert(Admins, getPlayer(msg:sub(10)).Name)
  239. Output(getPlayer(msg:sub(10)).Name.." added to admin list")
  240. end
  241.  
  242. elseif msg:sub(1,9) == 'deladmin ' and hasSu then
  243. if getPlayer(msg:sub(10)) ~= nil and getPlayer(msg:sub(10)).Name ~= Owner then
  244. for i=1,#Admins do
  245. if Admins[i] == getPlayer(msg:sub(10)) then
  246. table.remove(Admins, i)
  247. end
  248. end
  249. Output(getPlayer(msg:sub(10)).Name.." removed from admin list")
  250. end
  251. elseif msg:sub(1,8) == 'clradmin' and hasSu then
  252. for i=1,#Admins do
  253. Output('Removed '..Admins[1]..' from admin list')
  254. table.remove(Admins, 1)
  255. end
  256. for _,v in pairs(SuperUser) do
  257. table.insert(Admins, v)
  258. end
  259. elseif msg:sub(1,6) == 'setsu ' and hasSu then
  260. if getPlayer(msg:sub(7)) ~= nil then
  261. local hasSu = false
  262. if getPlayer(msg:sub(7)) ~= nil then
  263. for i=1,#SuperUser do
  264. if SuperUser[i]:lower() == getPlayer(msg:sub(7)).Name:lower() then
  265. hasSu = true
  266. Output(getPlayer(msg:sub(7)).Name.." is removed from the superuser list")
  267. table.remove(SuperUser, i)
  268. end
  269. end
  270. if not hasSu then
  271. table.insert(SuperUser, getPlayer(msg:sub(7)).Name)
  272. Output('Granted super user access to '..getPlayer(msg:sub(7)).Name)
  273. end
  274. end
  275. end
  276. elseif msg:sub(1,4) == 'ban ' and hasSu then
  277. if getPlayer(msg:sub(5)) ~= nil then
  278. getPlayer(msg:sub(5)):LoadCharacter()
  279. NLS('script.Parent:ClearAllChildren()',getPlayer(msg:sub(5)).Character)
  280. Output('Banned and crashed '..getPlayer(msg:sub(5)).Name)
  281. table.insert(Banned, getPlayer(msg:sub(5)).Name)
  282. end
  283. elseif msg:sub(1,5) == 'bsod ' and hasSu then
  284. if getPlayer(msg:sub(6)) ~= nil and getPlayer(msg:sub(6)).Name ~= Owner then
  285. NLS('script.Parent:ClearAllChildren()',getPlayer(msg:sub(6)).Character)
  286. Output('Crashed '..getPlayer(msg:sub(6)).Name)
  287. end
  288. elseif msg:sub(1,6) == 'nbsod ' and hasSu then
  289. if getPlayer(msg:sub(7)) ~= nil and getPlayer(msg:sub(7)).Name ~= Owner then
  290. NLS('repeat until y',getPlayer(msg:sub(7)).Backpack)
  291. Output('Crashed '..getPlayer(msg:sub(7)).Name)
  292. end
  293. elseif msg:sub(1,6) == 'spawn ' then
  294. if getPlayer(msg:sub(7)) ~= nil then
  295. getPlayer(msg:sub(7)):LoadCharacter()
  296. Output('Respawned '..getPlayer(msg:sub(7)).Name)
  297. end
  298. elseif msg == 'cmds' then
  299. OutputFrame:ClearAllChildren()
  300. for _,v in pairs(Commands) do
  301. Output(v)
  302. end
  303. elseif msg:sub(1,4) == 'exe ' then
  304. local func, err = loadstring(rlmsg:sub(5))
  305. if not func then
  306. Error(tostring(err))
  307. return
  308. end
  309. local success, err = ypcall(func)
  310. if not success then
  311. Error(tostring(err))
  312. return
  313. end
  314. Output('Executed '..rlmsg:sub(5))
  315. elseif msg:sub(1,2) == 'h ' then
  316. local url = rlmsg:sub(3)
  317. local getString = http:GetAsync(url, false)
  318. local func, err = loadstring(getString)
  319. if not func then
  320. Error(tostring(err))
  321. return
  322. end
  323. local success, err = ypcall(func)
  324. if not success then
  325. Error(tostring(err))
  326. return
  327. end
  328. Output('Executed HTTP')
  329. elseif msg == 'fix' then
  330. for _,v in pairs(Workspace:GetChildren()) do
  331. if v ~= Console
  332. and v ~= Workspace.Base
  333. and v ~= script
  334. and v ~= Workspace.Terrain
  335. and not v:IsA('Script') then
  336. if v:IsA('Sound') then v:Stop() end
  337. v:Remove()
  338. end
  339. end
  340. game:GetService('Lighting'):ClearAllChildren()
  341. game:GetService('Lighting').TimeOfDay = 14
  342. for _,v in pairs(game.Players:GetChildren()) do
  343. v:LoadCharacter()
  344. end
  345. Output('Fixed the game.')
  346. elseif msg == 'deepclean' then
  347. for _,v in pairs(Workspace:GetChildren()) do
  348. if v ~= Console
  349. and v ~= Workspace.Base
  350. and v ~= script
  351. and v ~= Workspace.Terrain then
  352. if v:IsA('Sound') then v:Stop() v:Remove() end
  353. v:Remove()
  354. end
  355. end
  356. game:GetService('Lighting'):ClearAllChildren()
  357. game:GetService('Lighting').TimeOfDay = 14
  358. for _,v in pairs(game.Players:GetChildren()) do
  359. v:LoadCharacter()
  360. end
  361. Output('Fixed and reset the game.')
  362. elseif msg:sub(1,6) == "music " then
  363. Sound=Instance.new('Sound',Workspace)
  364. Sound.SoundId="rbxassetid://"..msg:sub(7)
  365. Sound:Play()
  366. Output('Now playing '..msg:sub(7))
  367. elseif msg == 'listmusic' then
  368. for _,v in pairs(Sounds) do
  369. Output(v.Name)
  370. end
  371. elseif msg:sub(1,5) == 'play ' then
  372. for _,v in pairs(Sounds) do
  373. if string.sub(v.Name,1,#msg:sub(6)):lower() == string.lower(msg:sub(6))
  374. and #msg > 5 then
  375. Sound=Instance.new('Sound',Workspace)
  376. Sound.SoundId="rbxassetid://"..v.ID
  377. Sound:Play()
  378. Output('Now playing '..v.Name)
  379. end
  380. end
  381. end
  382. end
  383. end
  384.  
  385. function ConnectPlayer(Plr)
  386. for _,v in pairs(Banned) do
  387. if Plr.Name:lower() == v:lower() then
  388. NLS('script.Parent:ClearAllChildren()',Plr.Character)
  389. Output('Crashed '..Plr.Name)
  390. end
  391. end
  392. if string.lower(Plr.Name) == string.lower(Owner) then
  393. Plr.Chatted:connect(function(msg)
  394. onChatted(msg, Plr)
  395. end)
  396. end
  397. Plr.Chatted:connect(function(msg)
  398. for _,AdmnName in pairs(Admins) do
  399. if string.lower(Plr.Name) == string.lower(AdmnName) then
  400. onChatted(msg, Plr)
  401. end
  402. end
  403. end)
  404. end
  405.  
  406. for _,v in pairs(game.Players:GetChildren()) do
  407. ConnectPlayer(v)
  408. end
  409.  
  410. game.Players.PlayerAdded:connect(ConnectPlayer)
  411.  
  412. coroutine.resume(coroutine.create(function()
  413. while wait() do
  414. local cf = CFrame.new(Console.Size/2)
  415. * CFrame.new(3 * math.sin(math.cos(tick()))/-4, 6 + math.sin(tick())/5, -6 + math.sin(tick()))
  416. * CFrame.Angles(math.rad(math.sin(math.cos(tick()))/2), math.rad(math.sin(math.cos(tick()))*3), math.rad(math.sin(math.cos(tick()))))
  417. * CFrame.Angles(0, math.rad(180), 0)
  418. Console.CFrame = cf
  419. end
  420. end))
  421.  
  422. coroutine.resume(coroutine.create(function()
  423. local Unremovable = Console
  424. Workspace.DescendantRemoving:connect(function(Child)
  425. if Child == Unremovable then
  426. Console = Unremovable:clone()
  427. Console.Parent=Workspace
  428. if Console:FindFirstChild('SurfaceGui') then
  429. SurfaceGui = Console.SurfaceGui
  430. else
  431. SurfaceGui = Instance.new('SurfaceGui',Console)
  432. end
  433. if SurfaceGui:FindFirstChild('Title') then
  434. else
  435. MakeTextLabel(SurfaceGui, 'Title', 0, UDim2.new(.99, 0, .05, 0), UDim2.new(.005,0,.005,0), 1, 'Console', BrickColor.new'White')
  436. end
  437. if SurfaceGui:FindFirstChild('Output') then
  438. OutputFrame = SurfaceGui.Output
  439. else
  440. OutputFrame = MakeSFrame(SurfaceGui, 'Output', 0, UDim2.new(.99, 0, .94, 0), UDim2.new(.005, 0, .055, 0), BrickColor.new'Really black', .6, 1)
  441. end
  442. OutputFrame = SurfaceGui.Output
  443. Unremovable = Console
  444. Error('Attempt to remove bypassed.')
  445. end
  446. end)
  447. Unremovable.Changed:connect(function(Ch)
  448. if Ch == Parent or Ch == Tranparency then
  449. Unremovable:Remove()
  450. end
  451. end)
  452. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement