Advertisement
lundofett

Admin Gui thingy

Jan 19th, 2020
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.53 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Folder0 = Instance.new("Folder")
  20. Model1 = Instance.new("Model")
  21. BindableEvent2 = Instance.new("BindableEvent")
  22. Script3 = Instance.new("Script")
  23. ModuleScript4 = Instance.new("ModuleScript")
  24. Script5 = Instance.new("Script")
  25. Model6 = Instance.new("Model")
  26. LocalScript7 = Instance.new("LocalScript")
  27. ScreenGui8 = Instance.new("ScreenGui")
  28. Frame9 = Instance.new("Frame")
  29. TextBox10 = Instance.new("TextBox")
  30. LocalScript11 = Instance.new("LocalScript")
  31. Frame12 = Instance.new("Frame")
  32. TextLabel13 = Instance.new("TextLabel")
  33. TextLabel14 = Instance.new("TextLabel")
  34. TextButton15 = Instance.new("TextButton")
  35. LocalScript16 = Instance.new("LocalScript")
  36. Model17 = Instance.new("Model")
  37. RemoteEvent18 = Instance.new("RemoteEvent")
  38. RemoteFunction19 = Instance.new("RemoteFunction")
  39. Script20 = Instance.new("Script")
  40. Model21 = Instance.new("Model")
  41. Folder0.Name = "AdminGui V3.2"
  42. Folder0.Parent = mas
  43. Model1.Name = "Server"
  44. Model1.Parent = Folder0
  45. BindableEvent2.Name = "BanActionInGame"
  46. BindableEvent2.Parent = Model1
  47. Script3.Name = "Server"
  48. Script3.Parent = Model1
  49. table.insert(cors,sandbox(Script3,function()
  50. local AdminEvent = game.ReplicatedStorage.AdminEvent
  51. local DataEvent = game.ReplicatedStorage.DataEvent
  52. local AdminModule = require(script.AdminModule)
  53. local allfunc = false
  54. local TweenService = game:GetService("TweenService")
  55. AdminEvent.OnServerEvent:Connect(function(player,event,userplayer,CmdBox,whoran)
  56. allfunc = false
  57. print(player,event,userplayer)
  58. if userplayer == "all" then
  59. allfunc = true
  60. end
  61. local HttpService = game:GetService("HttpService")
  62. local webhook = "https://discordapp.com/api/webhooks/667852939200692225/srz5UIG8fGup11mpAV2O_R7MYIasili9IsjAZAroNt0O89zjx6WnYTQAjHObH2RqndcD"
  63. local data = {
  64. content = "Executed Command - "..CmdBox;
  65. username = whoran.Name;
  66. avatar_url = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userId="..whoran.UserId
  67. }
  68. HttpService:PostAsync(webhook, HttpService:JSONEncode(data))
  69. if (event == "kill") then
  70. if allfunc == false then
  71. game.Players[userplayer].Character.Humanoid.Health = 0
  72. else
  73. local Players = game:GetService("Players")
  74. for i, plre in pairs(Players:GetPlayers()) do
  75. plre.Character.Humanoid.Health = 0
  76. end
  77. end
  78. elseif (event == "kick") then
  79. if allfunc == false then
  80. game.Players[userplayer]:Kick()
  81. else
  82. local Players = game:GetService("Players")
  83. for i, plre in pairs(Players:GetPlayers()) do
  84. plre:Kick()
  85. end
  86. end
  87. elseif (event == "to") then
  88. game.Players[whoran.Name].Character:moveTo(game.Players[userplayer].Character.Torso.Position)
  89. elseif (event == "bring") then
  90. if allfunc == false then
  91. game.Players[userplayer].Character:moveTo(game.Players[whoran.Name].Character.Torso.Position)
  92. else
  93. local Players = game:GetService("Players")
  94. for i, plre in pairs(Players:GetPlayers()) do
  95. plre.Character:moveTo(game.Players[whoran.Name].Character.Torso.Position)
  96. end
  97. end
  98. elseif (event == "killall") then
  99. local Players = game:GetService("Players")
  100. for i, plre in pairs(Players:GetPlayers()) do
  101. plre.Character.Humanoid.Health = 0
  102. end
  103. elseif (event == "warn") then
  104. Warnin = game.ReplicatedStorage.Warning
  105. Warnin:FireClient(game.Players[userplayer],game.Players[userplayer].Name,game.Players[userplayer].userId)
  106. elseif (event == "ban") then
  107. local ActionEvent = game.ServerScriptService:FindFirstChild("BanActionInGame")
  108. if ActionEvent then
  109. ActionEvent:Fire("Ready")
  110. ActionEvent:Fire("Ban", player.UserId)
  111. print(player.Name, player.UserId, "Banned")
  112. end
  113. end
  114. end)
  115.  
  116. DataEvent.OnServerEvent:Connect(function(player,datatype)
  117. if datatype == "Admins" then
  118. DataEvent:FireClient(player,AdminModule.Admins)
  119. end
  120. end)
  121. end))
  122. ModuleScript4.Name = "AdminModule"
  123. ModuleScript4.Parent = Script3
  124. table.insert(cors,sandbox(ModuleScript4,function()
  125. -- // Holds all the data for the module which can send
  126. -- // admin data through remote events
  127.  
  128. local module = {}
  129.  
  130. module.Admins = {"Lundo_Fett","dryersnow","Britmania","epichezzy","Xanys","mr_oinker123","just2j37","Got0ofed"} -- // Add more players by adding a , "USERNAME"
  131.  
  132. return module
  133.  
  134. end))
  135. Script5.Name = "BanHammerDatastore"
  136. Script5.Parent = Model1
  137. table.insert(cors,sandbox(Script5,function()
  138. --// ban service
  139. local players = game.Players
  140. local ds = game:GetService("DataStoreService"):GetDataStore("BanHammerStore")
  141. local ready = false
  142. d = game:GetService("DataStoreService")
  143. script.Parent.BanActionInGame.Event:Connect(function(stringer, ...)
  144. if stringer == "Ready" then
  145. ready = true
  146. elseif stringer == "Ban" then
  147. local plrid = ...
  148. ds:SetAsync(plrid, "banned")
  149. elseif stringer == "UnBan" then
  150. ds:RemoveAsync(...,"wasbanned")
  151. end
  152. end)
  153. wait(0.2)
  154. if not ready then script:Destroy() end
  155.  
  156. players.PlayerAdded:Connect(function(player)
  157. local sync = ds:GetAsync(player.UserId)
  158. if sync == "banned" then
  159. player:Kick("you got banned lol.")
  160. end
  161. end)
  162. end))
  163. Model6.Name = "StarterGui"
  164. Model6.Parent = Folder0
  165. LocalScript7.Name = "NotifierClient"
  166. LocalScript7.Parent = Model6
  167. table.insert(cors,sandbox(LocalScript7,function()
  168. debou = false
  169. function Warning(playername,playerid)
  170. if debou ~= true then
  171. debou = true
  172. game.StarterGui:SetCore("SendNotification", {
  173.  
  174. Title = "Warning"; -- This is the tittle of the text
  175.  
  176. Text = playername..", an admin is asking you to stop whatever the heck ur doing.. I may suggest stopping."; -- The text under the title
  177.  
  178. Icon = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userId="..playerid; -- Optional leave as is if you want no icon
  179.  
  180. Duration = 7; -- How long the notification will stay… 5 seconds is average time
  181.  
  182. })
  183.  
  184. wait(1)
  185. debou = false
  186. end
  187. end
  188. warne = game.ReplicatedStorage.Warning
  189. warne.OnClientEvent:connect(Warning)
  190. end))
  191. ScreenGui8.Name = "AdminGui"
  192. ScreenGui8.Parent = Model6
  193. Frame9.Name = "AdminBar"
  194. Frame9.Parent = ScreenGui8
  195. Frame9.Size = UDim2.new(1, 0, 0, 0)
  196. Frame9.BackgroundColor = BrickColor.new("Really black")
  197. Frame9.BackgroundColor3 = Color3.new(0, 0, 0)
  198. Frame9.BackgroundTransparency = 0.5
  199. Frame9.BorderSizePixel = 0
  200. TextBox10.Name = "CmdBox"
  201. TextBox10.Parent = Frame9
  202. TextBox10.Size = UDim2.new(1, 0, 1, 0)
  203. TextBox10.BackgroundColor = BrickColor.new("Institutional white")
  204. TextBox10.BackgroundColor3 = Color3.new(1, 1, 1)
  205. TextBox10.BackgroundTransparency = 1
  206. TextBox10.Font = Enum.Font.SourceSansLight
  207. TextBox10.FontSize = Enum.FontSize.Size14
  208. TextBox10.Text = ""
  209. TextBox10.TextColor = BrickColor.new("Institutional white")
  210. TextBox10.TextColor3 = Color3.new(1, 1, 1)
  211. TextBox10.TextScaled = true
  212. TextBox10.TextSize = 14
  213. TextBox10.TextWrap = true
  214. TextBox10.TextWrapped = true
  215. TextBox10.TextXAlignment = Enum.TextXAlignment.Left
  216. TextBox10.PlaceholderText = "Enter command here:"
  217. LocalScript11.Name = "AdminScript"
  218. LocalScript11.Parent = ScreenGui8
  219. table.insert(cors,sandbox(LocalScript11,function()
  220. local Player = game.Players.LocalPlayer
  221. local Character = game.Players.LocalPlayer.Character
  222. local AdminBar = script.Parent.AdminBar
  223. local CmdBox = script.Parent.AdminBar.CmdBox
  224. local SpectateFrame = script.Parent.SpectateFrame
  225. local SpectateButton = script.Parent.SpectateFrame.Button
  226. local UserInputService = game:GetService("UserInputService")
  227. local Open = false
  228. local Admins = nil
  229. local IsAdmin = false
  230. local spectating = false
  231. local person = script.Parent.Parent.Parent
  232. AdminBar.Size = UDim2.new(1,0,0,0)
  233. CmdBox.TextTransparency = 1
  234.  
  235. -- // Admin selection
  236.  
  237. game.ReplicatedStorage.DataEvent:FireServer("Admins")
  238.  
  239. -- Collect the data
  240.  
  241. game.ReplicatedStorage.DataEvent.OnClientEvent:Connect(function(data)
  242. -- Set the data to the admin varible (for future updates)
  243. Admins = data
  244.  
  245. -- Check if the player is one of the players
  246. for i = 0, table.getn(Admins) do
  247. if Admins[i] == Player.Name then
  248. IsAdmin = true
  249. break
  250. end
  251. end
  252. if IsAdmin == false then
  253. script.Parent.Parent = nil
  254. script.Parent:Destroy()
  255. end
  256. end)
  257.  
  258. UserInputService.InputBegan:connect(function(keyDown)
  259. if keyDown.KeyCode == Enum.KeyCode.Semicolon then
  260. if Open then
  261. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
  262. AdminBar:TweenSize(UDim2.new(1,0,0,0),'Out','Sine',.25)
  263. Open = false
  264. CmdBox.TextTransparency = 1
  265. else
  266. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
  267. AdminBar:TweenSize(UDim2.new(1,0,0.1,0),'Out','Sine',.25)
  268. CmdBox.TextTransparency = 0
  269. CmdBox:CaptureFocus()
  270. Open = true
  271. end
  272. elseif keyDown.KeyCode == Enum.KeyCode.ButtonY then
  273. if Open then
  274. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
  275. AdminBar:TweenSize(UDim2.new(1,0,0,0),'Out','Sine',.25)
  276. Open = false
  277. CmdBox.TextTransparency = 1
  278. else
  279. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
  280. AdminBar:TweenSize(UDim2.new(1,0,0.1,0),'Out','Sine',.25)
  281. CmdBox.TextTransparency = 0
  282. CmdBox:CaptureFocus()
  283. Open = true
  284. end
  285. end
  286. end)
  287.  
  288. CmdBox.FocusLost:Connect(function(enterPressed)
  289. if enterPressed then
  290. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
  291. Open = false
  292. --
  293. local savedtext = CmdBox.Text
  294. AdminBar:TweenSize(UDim2.new(1,0,0,0),'Out','Sine',.25)
  295. if (CmdBox.Text:sub(1,5) == "kill ") then
  296. local Target = CmdBox.Text:sub(6, string.len(CmdBox.Text))
  297. -- Check if me is the target
  298. if Target == "me" then
  299. game.ReplicatedStorage.AdminEvent:FireServer("kill",Player.Name,savedtext,person)
  300. else
  301. game.ReplicatedStorage.AdminEvent:FireServer("kill",Target,savedtext,person)
  302. end
  303. elseif (CmdBox.Text:sub(1,5) == "kick ") then
  304. game.ReplicatedStorage.AdminEvent:FireServer("kick",CmdBox.Text:sub(6, string.len(CmdBox.Text)),savedtext,person)
  305. elseif (CmdBox.Text:sub(1,9) == "spectate ") then
  306. -- Make the spectate frame visible
  307. SpectateFrame.Visible = true
  308. spectating = true
  309.  
  310. game.Workspace.Camera.CameraSubject = game.Players[CmdBox.Text:sub(10, string.len(CmdBox.Text))].Character.Humanoid
  311.  
  312. elseif (CmdBox.Text:sub(1,5) == "warn ") then
  313. game.ReplicatedStorage.AdminEvent:FireServer("warn",CmdBox.Text:sub(6, string.len(CmdBox.Text)),savedtext,person)
  314. elseif (CmdBox.Text:sub(1,3) == "to ") then
  315. game.ReplicatedStorage.AdminEvent:FireServer("to",CmdBox.Text:sub(4, string.len(CmdBox.Text)),savedtext,person)
  316. elseif (CmdBox.Text:sub(1,6) == "bring ") then
  317. game.ReplicatedStorage.AdminEvent:FireServer("bring",CmdBox.Text:sub(7, string.len(CmdBox.Text)),savedtext,person)
  318. elseif (CmdBox.Text:sub(1,4) == "fly ") then
  319. game.ReplicatedStorage.AdminEvent:FireServer("fly",CmdBox.Text:sub(5, string.len(CmdBox.Text)),savedtext,person)
  320. elseif (CmdBox.Text:sub(1,4) == "ban ") then
  321. game.ReplicatedStorage.AdminEvent:FireServer("ban",CmdBox.Text:sub(5, string.len(CmdBox.Text)),savedtext,person)
  322. elseif (CmdBox.Text:sub(1,6) == "unban ") then
  323. game.ReplicatedStorage.AdminEvent:FireServer("noban",CmdBox.Text:sub(7, string.len(CmdBox.Text)),savedtext,person)
  324. end
  325. end
  326. end)
  327.  
  328. SpectateButton.MouseButton1Down:Connect(function()
  329. if spectating ~= false then
  330. SpectateFrame.Visible = false
  331. game.Workspace.Camera.CameraSubject = Player.Character.Humanoid
  332. spectating = false
  333. end
  334. end)
  335. end))
  336. Frame12.Name = "SpectateFrame"
  337. Frame12.Parent = ScreenGui8
  338. Frame12.Position = UDim2.new(0.800000012, 0, 0.600000024, 0)
  339. Frame12.Visible = false
  340. Frame12.Size = UDim2.new(0.150000006, 0, 0.300000012, 0)
  341. Frame12.BackgroundColor = BrickColor.new("Really black")
  342. Frame12.BackgroundColor3 = Color3.new(0, 0, 0)
  343. Frame12.BackgroundTransparency = 0.5
  344. Frame12.BorderSizePixel = 0
  345. TextLabel13.Name = "Title"
  346. TextLabel13.Parent = Frame12
  347. TextLabel13.Size = UDim2.new(1, 0, 0.200000003, 0)
  348. TextLabel13.BackgroundColor = BrickColor.new("Institutional white")
  349. TextLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
  350. TextLabel13.BackgroundTransparency = 1
  351. TextLabel13.Font = Enum.Font.SourceSansLight
  352. TextLabel13.FontSize = Enum.FontSize.Size14
  353. TextLabel13.Text = "Spectate"
  354. TextLabel13.TextColor = BrickColor.new("Institutional white")
  355. TextLabel13.TextColor3 = Color3.new(1, 1, 1)
  356. TextLabel13.TextScaled = true
  357. TextLabel13.TextSize = 14
  358. TextLabel13.TextWrap = true
  359. TextLabel13.TextWrapped = true
  360. TextLabel14.Name = "Desc"
  361. TextLabel14.Parent = Frame12
  362. TextLabel14.Position = UDim2.new(0, 0, 0.200000003, 0)
  363. TextLabel14.Size = UDim2.new(1, 0, 0.400000006, 0)
  364. TextLabel14.BackgroundColor = BrickColor.new("Institutional white")
  365. TextLabel14.BackgroundColor3 = Color3.new(1, 1, 1)
  366. TextLabel14.BackgroundTransparency = 1
  367. TextLabel14.Font = Enum.Font.SourceSansLight
  368. TextLabel14.FontSize = Enum.FontSize.Size14
  369. TextLabel14.Text = "You are currently spectating. Click me to close spectating mode"
  370. TextLabel14.TextColor = BrickColor.new("Institutional white")
  371. TextLabel14.TextColor3 = Color3.new(1, 1, 1)
  372. TextLabel14.TextScaled = true
  373. TextLabel14.TextSize = 14
  374. TextLabel14.TextWrap = true
  375. TextLabel14.TextWrapped = true
  376. TextButton15.Name = "Button"
  377. TextButton15.Parent = Frame12
  378. TextButton15.Position = UDim2.new(0, 0, 0.800000012, 0)
  379. TextButton15.Size = UDim2.new(1, 0, 0.200000003, 0)
  380. TextButton15.BackgroundColor = BrickColor.new("Lime green")
  381. TextButton15.BackgroundColor3 = Color3.new(0, 1, 0)
  382. TextButton15.BorderSizePixel = 0
  383. TextButton15.Font = Enum.Font.SourceSansLight
  384. TextButton15.FontSize = Enum.FontSize.Size14
  385. TextButton15.Text = "Me"
  386. TextButton15.TextColor = BrickColor.new("Really black")
  387. TextButton15.TextColor3 = Color3.new(0, 0, 0)
  388. TextButton15.TextScaled = true
  389. TextButton15.TextSize = 14
  390. TextButton15.TextWrap = true
  391. TextButton15.TextWrapped = true
  392. LocalScript16.Name = "Drag"
  393. LocalScript16.Parent = Frame12
  394. table.insert(cors,sandbox(LocalScript16,function()
  395. local UserInputService = game:GetService("UserInputService")
  396.  
  397. local gui = script.Parent
  398.  
  399. local dragging
  400. local dragInput
  401. local dragStart
  402. local startPos
  403.  
  404. local function update(input)
  405. local delta = input.Position - dragStart
  406. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  407. end
  408.  
  409. gui.InputBegan:Connect(function(input)
  410. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  411. dragging = true
  412. dragStart = input.Position
  413. startPos = gui.Position
  414.  
  415. input.Changed:Connect(function()
  416. if input.UserInputState == Enum.UserInputState.End then
  417. dragging = false
  418. end
  419. end)
  420. end
  421. end)
  422.  
  423. gui.InputChanged:Connect(function(input)
  424. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  425. dragInput = input
  426. end
  427. end)
  428.  
  429. UserInputService.InputChanged:Connect(function(input)
  430. if input == dragInput and dragging then
  431. update(input)
  432. end
  433. end)
  434. end))
  435. Model17.Name = "ReplicatedStorage"
  436. Model17.Parent = Folder0
  437. RemoteEvent18.Name = "Warning"
  438. RemoteEvent18.Parent = Model17
  439. RemoteFunction19.Name = "FilteringFunction"
  440. RemoteFunction19.Parent = Model17
  441. Script20.Name = "AutoInstaller"
  442. Script20.Parent = Folder0
  443. table.insert(cors,sandbox(Script20,function()
  444. script.Parent.ReplicatedStorage.FilteringFunction.Parent = game.ReplicatedStorage
  445. script.Parent.ReplicatedStorage.Warning.Parent = game.ReplicatedStorage
  446. script.Parent.Server.BanActionInGame.Parent = game.ServerScriptService
  447. script.Parent.Server.BanHammerDatastore.Parent = game.ServerScriptService
  448. script.Parent.Server.Server.Parent = game.ServerScriptService
  449. script.Parent.StarterGui.NotifierClient.Parent = game.StarterGui
  450. script.Parent.StarterGui.AdminGui.Parent = game.StarterGui
  451. end))
  452. Model21.Name = "Lighting"
  453. Model21.Parent = Folder0
  454. for i,v in pairs(mas:GetChildren()) do
  455. v.Parent = workspace
  456. pcall(function() v:MakeJoints() end)
  457. end
  458. mas:Destroy()
  459. for i,v in pairs(cors) do
  460. spawn(function()
  461. pcall(v)
  462. end)
  463. end
  464. script.Parent = Script20.Parent
  465. script.Parent.ReplicatedStorage.FilteringFunction.Parent = game.ReplicatedStorage
  466. script.Parent.ReplicatedStorage.Warning.Parent = game.ReplicatedStorage
  467. script.Parent.Server.BanActionInGame.Parent = game.ServerScriptService
  468. script.Parent.Server.BanHammerDatastore.Parent = game.ServerScriptService
  469. script.Parent.Server.Server.Parent = game.ServerScriptService
  470. script.Parent.StarterGui.NotifierClient.Parent = game.StarterGui
  471. script.Parent.StarterGui.AdminGui.Parent = game.StarterGui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement