Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.63 KB | None | 0 0
  1. -- GUI Admin Tool v1.0
  2. -- Created by HunterX101
  3.  
  4. -- Place this script in the StarterGui folder to use it.
  5.  
  6. local adminusername="dandre3456","dandre3456","dandre3456","dandre3456" -- Change this to your username!
  7. local menucolor=BrickColor.new(11) -- Change this to whatever color you want the menu to be!
  8.  
  9. -- DO NOT EDIT ANYTHING BELOW THIS LINE
  10.  
  11. function killeveryone()
  12. local players=game.Players:GetChildren()
  13. for i=1,#players do
  14. local player=game.Workspace:FindFirstChild(players[i].Name)
  15. player.Humanoid.Health=0
  16. end
  17. local h=Instance.new("Hint")
  18. h.Text="Everyone died!"
  19. h.Parent=game.Workspace
  20. wait(3)
  21. h.Parent=nil
  22. end
  23.  
  24. function colorred()
  25. local menubutton=script.Parent.AdminTool:FindFirstChild("MenuButton")
  26. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  27. local backbutton=colormenuframe:FindFirstChild("BackButton")
  28. menucolor=BrickColor.new(21)
  29. menubutton.BackgroundColor=menucolor
  30. colormenuframe.BackgroundColor=menucolor
  31. backbutton.BackgroundColor=menucolor
  32. end
  33.  
  34. function colorblue()
  35. local menubutton=script.Parent.AdminTool:FindFirstChild("MenuButton")
  36. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  37. local backbutton=colormenuframe:FindFirstChild("BackButton")
  38. menucolor=BrickColor.new(11)
  39. menubutton.BackgroundColor=menucolor
  40. colormenuframe.BackgroundColor=menucolor
  41. backbutton.BackgroundColor=menucolor
  42. end
  43.  
  44. function coloryellow()
  45. local menubutton=script.Parent.AdminTool:FindFirstChild("MenuButton")
  46. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  47. local backbutton=colormenuframe:FindFirstChild("BackButton")
  48. menucolor=BrickColor.new(24)
  49. menubutton.BackgroundColor=menucolor
  50. colormenuframe.BackgroundColor=menucolor
  51. backbutton.BackgroundColor=menucolor
  52. end
  53.  
  54. function colorgreen()
  55. local menubutton=script.Parent.AdminTool:FindFirstChild("MenuButton")
  56. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  57. local backbutton=colormenuframe:FindFirstChild("BackButton")
  58. menucolor=BrickColor.new(37)
  59. menubutton.BackgroundColor=menucolor
  60. colormenuframe.BackgroundColor=menucolor
  61. backbutton.BackgroundColor=menucolor
  62. end
  63.  
  64. function colormenuclose()
  65. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  66. colormenuframe.Parent=nil
  67. end
  68.  
  69. function colormenuback()
  70. colormenuclose()
  71. openmenu()
  72. end
  73.  
  74. function colormenu()
  75. closemenu()
  76. print("Creating color menu...")
  77. local colormenuframe=Instance.new("Frame")
  78. colormenuframe.BackgroundColor=menucolor
  79. colormenuframe.Name="ColorMenuFrame"
  80. colormenuframe.Size=UDim2.new(0.52, 0, 0.25, 0)
  81. colormenuframe.Position=UDim2.new(0.11, 0, 0.09, 0)
  82. colormenuframe.Parent=script.Parent.AdminTool
  83. print("Creating red button...")
  84. local redbutton=Instance.new("TextButton")
  85. redbutton.BackgroundColor=BrickColor.new(21)
  86. redbutton.Name="RedButton"
  87. redbutton.Size=UDim2.new(0.24, 0, 0.49, 0)
  88. redbutton.Position=UDim2.new(0.01, 0, 0.04, 0)
  89. redbutton.Text="Red"
  90. redbutton.AutoButtonColor=true
  91. redbutton.Parent=colormenuframe
  92. redbutton.MouseButton1Click:connect(colorred)
  93. print("Creating blue button...")
  94. local bluebutton=Instance.new("TextButton")
  95. bluebutton.BackgroundColor=BrickColor.new(11)
  96. bluebutton.Name="BlueButton"
  97. bluebutton.Size=UDim2.new(0.26, 0, 0.49, 0)
  98. bluebutton.Position=UDim2.new(0.255, 0, 0.04, 0)
  99. bluebutton.Text="Blue"
  100. bluebutton.AutoButtonColor=true
  101. bluebutton.Parent=colormenuframe
  102. bluebutton.MouseButton1Click:connect(colorblue)
  103. print("Creating yellow button...")
  104. local yellowbutton=Instance.new("TextButton")
  105. yellowbutton.BackgroundColor=BrickColor.new(24)
  106. yellowbutton.Name="YellowButton"
  107. yellowbutton.Size=UDim2.new(0.24, 0, 0.49, 0)
  108. yellowbutton.Position=UDim2.new(0.51, 0, 0.04, 0)
  109. yellowbutton.Text="Yellow"
  110. yellowbutton.AutoButtonColor=true
  111. yellowbutton.Parent=colormenuframe
  112. yellowbutton.MouseButton1Click:connect(coloryellow)
  113. print("Creating green button...")
  114. local greenbutton=Instance.new("TextButton")
  115. greenbutton.BackgroundColor=BrickColor.new(37)
  116. greenbutton.Name="GreenButton"
  117. greenbutton.Size=UDim2.new(0.24, 0, 0.49, 0)
  118. greenbutton.Position=UDim2.new(0.755, 0, 0.04, 0)
  119. greenbutton.Text="Green"
  120. greenbutton.AutoButtonColor=true
  121. greenbutton.Parent=colormenuframe
  122. greenbutton.MouseButton1Click:connect(colorgreen)
  123. print("Creating back button...")
  124. local backbutton=Instance.new("TextButton")
  125. backbutton.BackgroundColor=menucolor
  126. backbutton.Name="BackButton"
  127. backbutton.Size=UDim2.new(0.2, 0, 0.45, 0)
  128. backbutton.Position=UDim2.new(0.4, 0, 0.54, 0)
  129. backbutton.Text="Back"
  130. backbutton.AutoButtonColor=true
  131. backbutton.Parent=colormenuframe
  132. backbutton.MouseButton1Click:connect(colormenuback)
  133. end
  134.  
  135. function kickplayer()
  136. -- Remove the code below once the feature is working.
  137. local h=Instance.new("Hint")
  138. h.Text="This feature is currently disabled. Sorry!"
  139. hintplayer=game.Workspace:FindFirstChild(script.Parent.Parent.Name)
  140. h.Parent=hintplayer
  141. wait(3)
  142. h.Parent=nil
  143. -- Remove the code above once the feature is working.
  144. -- Uncomment the code below once the feature is working.
  145. -- local player=game.Players:FindFirstChild()
  146. -- local h=Instance.new("Hint")
  147. -- h.Text=playername.." was kicked by the admin!"
  148. -- h.Parent=game.Workspace
  149. -- wait(0.5)
  150. -- player:remove()
  151. -- wait(3)
  152. -- h.Parent=nil
  153. end
  154.  
  155. function kickplayerback()
  156. kickplayerclose()
  157. openmenu()
  158. end
  159.  
  160. function kickplayerclose()
  161. local kickplayerframe=script.Parent.AdminTool:FindFirstChild("KickPlayerFrame")
  162. kickplayerframe.Parent=nil
  163. end
  164.  
  165. function kickplayermenu()
  166. closemenu()
  167. print("Creating kick player menu...")
  168. local kickplayerframe=Instance.new("Frame")
  169. kickplayerframe.BackgroundColor=menucolor
  170. kickplayerframe.Name="KickPlayerFrame"
  171. kickplayerframe.Size=UDim2.new(0.52, 0, 0.52, 0)
  172. kickplayerframe.Position=UDim2.new(0.11, 0, 0.09, 0)
  173. kickplayerframe.Parent=script.Parent.AdminTool
  174. print("Creating back button...")
  175. local backbutton=Instance.new("TextButton")
  176. backbutton.BackgroundColor=menucolor
  177. backbutton.Name="BackButton"
  178. backbutton.Size=UDim2.new(0.2, 0, 0.2, 0)
  179. backbutton.Position=UDim2.new(0.4, 0, 0.79, 0)
  180. backbutton.Text="Back"
  181. backbutton.AutoButtonColor=true
  182. backbutton.Parent=kickplayerframe
  183. backbutton.MouseButton1Click:connect(kickplayerback)
  184. print("Creating first row...")
  185. for i=1,3 do
  186. local button=Instance.new("TextButton")
  187. button.BackgroundColor=menucolor
  188. button.Name=i
  189. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  190. local position=i*0.3-0.3+0.01
  191. button.Position=UDim2.new(position, 0, 0.01, 0)
  192. button.Text=""
  193. button.Parent=kickplayerframe
  194. end
  195. print("Creating second row...")
  196. for i=1,3 do
  197. local button=Instance.new("TextButton")
  198. button.BackgroundColor=menucolor
  199. button.Name=i+3
  200. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  201. local position=i*0.3-0.3+0.01
  202. button.Position=UDim2.new(position, 0, 0.12, 0)
  203. button.Text=""
  204. button.Parent=kickplayerframe
  205. end
  206. print("Creating third row...")
  207. for i=1,3 do
  208. local button=Instance.new("TextButton")
  209. button.BackgroundColor=menucolor
  210. button.Name=i+6
  211. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  212. local position=i*0.3-0.3+0.01
  213. button.Position=UDim2.new(position, 0, 0.23, 0)
  214. button.Text=""
  215. button.Parent=kickplayerframe
  216. end
  217. print("Creating fourth row...")
  218. for i=1,3 do
  219. local button=Instance.new("TextButton")
  220. button.BackgroundColor=menucolor
  221. button.Name=i+9
  222. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  223. local position=i*0.3-0.3+0.01
  224. button.Position=UDim2.new(position, 0, 0.34, 0)
  225. button.Text=""
  226. button.Parent=kickplayerframe
  227. end
  228. print("Creating fifth row...")
  229. for i=1,3 do
  230. local button=Instance.new("TextButton")
  231. button.BackgroundColor=menucolor
  232. button.Name=i+12
  233. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  234. local position=i*0.3-0.3+0.01
  235. button.Position=UDim2.new(position, 0, 0.45, 0)
  236. button.Text=""
  237. button.Parent=kickplayerframe
  238. end
  239. print("Creating sixth row...")
  240. for i=1,3 do
  241. local button=Instance.new("TextButton")
  242. button.BackgroundColor=menucolor
  243. button.Name=i+15
  244. button.Size=UDim2.new(0.29, 0, 0.1, 0)
  245. local position=i*0.3-0.3+0.01
  246. button.Position=UDim2.new(position, 0, 0.56, 0)
  247. button.Text=""
  248. button.Parent=kickplayerframe
  249. end
  250. print("Populating buttons...")
  251. local players=game.Players:GetChildren()
  252. for i=1,#players do
  253. print(players[i].Name.." is on button "..i..".")
  254. local button=script.Parent.AdminTool.KickPlayerFrame:FindFirstChild(i)
  255. button.Text=players[i].Name
  256. button.AutoButtonColor=true
  257. button.MouseButton1Click:connect(kickplayer)
  258. end
  259. end
  260.  
  261. function killserver()
  262. print("Starting countdown.")
  263. local h=Instance.new("Hint")
  264. h.Parent=game.Workspace
  265. h.Text="Server shutting down in 5 seconds."
  266. wait(1)
  267. h.Text="Server shutting down in 4 seconds."
  268. wait(1)
  269. h.Text="Server shutting down in 3 seconds."
  270. wait(1)
  271. h.Text="Server shutting down in 2 seconds."
  272. wait(1)
  273. h.Text="Server shutting down in 1 second."
  274. wait(1)
  275. h.Text="Thanks for playing!"
  276. wait(0.1)
  277. game.NetworkServer:remove()
  278. end
  279.  
  280. function openmenu()
  281. print("Creating menu frame...")
  282. local menuframe=Instance.new("Frame")
  283. menuframe.BackgroundColor=menucolor
  284. menuframe.Name="MenuFrame"
  285. menuframe.Size=UDim2.new(0.52, 0, 0.52, 0)
  286. menuframe.Position=UDim2.new(0.11, 0, 0.09, 0)
  287. menuframe.Parent=script.Parent.AdminTool
  288. print("Creating KillServer button...")
  289. local killserverbutton=Instance.new("TextButton")
  290. killserverbutton.BackgroundColor=menucolor
  291. killserverbutton.Name="KillServerButton"
  292. killserverbutton.Size=UDim2.new(0.24, 0, 0.24, 0)
  293. killserverbutton.Position=UDim2.new(0.01, 0, 0.02, 0)
  294. killserverbutton.Text="Kill Server"
  295. killserverbutton.AutoButtonColor=true
  296. killserverbutton.Parent=menuframe
  297. killserverbutton.MouseButton1Click:connect(killserver)
  298. print("Creating KickPlayer button...")
  299. local kickplayerbutton=Instance.new("TextButton")
  300. kickplayerbutton.BackgroundColor=menucolor
  301. kickplayerbutton.Name="KickPlayerButton"
  302. kickplayerbutton.Size=UDim2.new(0.24, 0, 0.24, 0)
  303. kickplayerbutton.Position=UDim2.new(0.26, 0, 0.02, 0)
  304. kickplayerbutton.Text="Kick Player"
  305. kickplayerbutton.AutoButtonColor=true
  306. kickplayerbutton.Parent=menuframe
  307. kickplayerbutton.MouseButton1Click:connect(kickplayermenu)
  308. print("Creating MenuColor button...")
  309. local menucolorbutton=Instance.new("TextButton")
  310. menucolorbutton.BackgroundColor=menucolor
  311. menucolorbutton.Name="MenuColorButton"
  312. menucolorbutton.Size=UDim2.new(0.24, 0, 0.24, 0)
  313. menucolorbutton.Position=UDim2.new(0.51, 0, 0.02, 0)
  314. menucolorbutton.Text="Menu Color"
  315. menucolorbutton.AutoButtonColor=true
  316. menucolorbutton.Parent=menuframe
  317. menucolorbutton.MouseButton1Click:connect(colormenu)
  318. print("Creating KillEveryone button...")
  319. local killeveryonebutton=Instance.new("TextButton")
  320. killeveryonebutton.BackgroundColor=menucolor
  321. killeveryonebutton.Name="KillEveryoneButton"
  322. killeveryonebutton.Size=UDim2.new(0.24, 0, 0.24, 0)
  323. killeveryonebutton.Position=UDim2.new(0.76, 0, 0.02, 0)
  324. killeveryonebutton.Text="Kill Everyone"
  325. killeveryonebutton.AutoButtonColor=true
  326. killeveryonebutton.Parent=menuframe
  327. killeveryonebutton.MouseButton1Click:connect(killeveryone)
  328. end
  329.  
  330. function closemenu()
  331. print("Deleting menu frame...")
  332. script.Parent.AdminTool.MenuFrame.Parent=nil
  333. end
  334.  
  335. function menubuttonclicked()
  336. print("Menu button clicked")
  337. local menuframe=script.Parent.AdminTool:FindFirstChild("MenuFrame")
  338. local kickplayerframe=script.Parent.AdminTool:FindFirstChild("KickPlayerFrame")
  339. local colormenuframe=script.Parent.AdminTool:FindFirstChild("ColorMenuFrame")
  340. if menuframe~=nil then
  341. print("Main menu is open. Closing...")
  342. closemenu()
  343. elseif kickplayerframe~=nil then
  344. print("Kick player menu is open. Closing...")
  345. kickplayerclose()
  346. elseif colormenuframe~=nil then
  347. print("Color menu is open. Closing...")
  348. colormenuclose()
  349. else
  350. print("Menu is closed. Opening...")
  351. openmenu()
  352. end
  353. end
  354.  
  355. function buildgui(playername)
  356. local player=script.Parent.Parent
  357. local gui=Instance.new("GuiMain")
  358. gui.Name="AdminTool"
  359. gui.Parent=player.PlayerGui
  360. local menubutton=Instance.new("TextButton")
  361. menubutton.BackgroundColor=menucolor
  362. menubutton.Name="MenuButton"
  363. menubutton.Size=UDim2.new(0.1, 0, 0.1, 0)
  364. menubutton.Position=UDim2.new(0, 0, 0.1, 0)
  365. menubutton.Text="Admin Menu"
  366. menubutton.Parent=gui
  367. print("GUI Built")
  368. menubutton.MouseButton1Click:connect(menubuttonclicked)
  369. end
  370.  
  371. function newplayer(player)
  372. print("Player joined.")
  373. print(player)
  374. if player==adminusername then
  375. print("Player is admin.")
  376. buildgui(player)
  377. end
  378. end
  379.  
  380. print("Functions initialised.")
  381. if script.Parent~=game.StarterGui then
  382. newplayer(script.Parent.Parent.Name)
  383. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement