Advertisement
plytalent

admin gui

May 29th, 2019
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.79 KB | None | 0 0
  1. wait(3)
  2. local plrs = game:GetService("Players")
  3. local Player =plrs:FindFirstChild("plytalent")
  4. local remote = Instance.new("RemoteEvent",script)
  5. --local remote = workspace.RRREEEMMMOOOTTTEEE
  6. remote.Name = "RRREEEMMMOOOTTTEEE"
  7. whitelist = {"plytalent","Christyhi","ozzak1003"}
  8. script.Parent = Player.PlayerGui
  9. null = "TextBox"
  10. stole = null
  11. stolereason = null
  12. stolescriptname = null
  13. loaded_map = nil
  14.  
  15. function getplayer(pst)
  16.     if string.len(pst) <= 2 then error'2short' end
  17.    
  18.     for i,v in pairs(plrs:GetPlayers()) do
  19.         if string.find(string.upper(v.Name),string.upper(pst)) == 1 then
  20.             return v
  21.         end
  22.     end
  23.     return nil
  24. end
  25.  
  26. remote.OnServerEvent:Connect(function(player,playername,reason,scriptname,button)
  27.     if player then
  28.         if playername ~= stole then
  29. --          print(player.Name.." Has Fire Remote Event Player name: "..playername)
  30. --          remote:FireClient(Player,player.Name.." Has Fire Remote Event Player name: "..playername)
  31.             print(stole.."\n"..playername)
  32.             remote:FireClient(Player,stole.."\n"..playername)
  33.             stole = playername
  34.         else
  35.             stole = stole
  36.         end
  37.         if reason ~= stolereason then
  38. --          print(player.Name.." Has Fire Remote Event reason: "..reason)
  39. --          remote:FireClient(Player,player.Name.." Has Fire Remote Event reason: "..reason)
  40.             stolereason = reason
  41.         else
  42.             stolereason = stolereason
  43.         end
  44.         if scriptname ~= stolescriptname then
  45. --          print(player.Name.." Has Fire Remote Event script name: "..scriptname)
  46. --          remote:FireClient(Player,player.Name.." Has Fire Remote Event script name: "..scriptname)
  47.             stolescriptname = scriptname
  48.         else
  49.             stolescriptname = stolescriptname
  50.         end
  51.         if button then
  52.             print(player.Name.." Has Fire Remote Event button: "..button)
  53.             if plrs:FindFirstChild(stole) then
  54.                 print("Player check pass")
  55.                 remote:FireClient(Player,"Player check pass")
  56.                 target = plrs:FindFirstChild(stole)
  57.                 if button == "KICK" then
  58.                     target:Kick(tostring(stolereason))
  59.                 elseif button == "BAN" then
  60.                     table.insert(banlist,#banlist+1,stole)
  61.                 elseif button == "KILL" then
  62.                     target.Character:FindFirstChildOfClass("Humanoid").MaxHealth = 0
  63.                     target.Character:FindFirstChildOfClass("Humanoid").Health = 0
  64.                 elseif button == "HEAL" then
  65.                     target.Character:FindFirstChildOfClass("Humanoid").Health = target.Character:FindFirstChildOfClass("Humanoid").MaxHealth
  66.                 elseif button == "RESET" then
  67.                     target:LoadCharacter()
  68.                 elseif button == "GIVESCRIPT" then
  69.                     scriptclone = script.scripts[scriptname]:Clone()
  70.                     scriptclone.Parent = target.Character
  71.                     scriptclone.Disabled = false
  72.                 elseif button == "ADMIN" then
  73.                     table.insert(whitelist,#whitelist+1,stole)
  74.                     for i = 1 , #whitelist do
  75.                         print(whitelist[i])
  76.                         remote:FireClient(Player,whitelist[i])
  77.                         if i == #whitelist then
  78.                             print("\n")
  79.                         end
  80.                     end
  81.                 end
  82.             else
  83.                 print("Player check FAIL")
  84.                 print(stole)
  85.                 remote:FireClient(Player,"Player check FAIL\n"..stole)
  86.             end
  87.         end
  88.     end
  89. end)
  90. banlist ={}
  91.  
  92. Maingui = Instance.new("ScreenGui",Player.PlayerGui)
  93. Mainframe = Instance.new("ScrollingFrame",Maingui)
  94. reset = Instance.new("TextButton",Mainframe)
  95. PLAYERNAME = Instance.new("TextBox",Mainframe)
  96. REASON = Instance.new("TextBox",Mainframe)
  97. SCRIPTNAME = Instance.new("TextBox",Mainframe)
  98. GIVESCRIPT =Instance.new("TextButton",Mainframe)
  99. BAN = Instance.new("TextButton",Mainframe)
  100. KICK = Instance.new("TextButton",Mainframe)
  101. HEAL = Instance.new("TextButton",Mainframe)
  102. KILL = Instance.new("TextButton",Mainframe)
  103. ADMIN = Instance.new("TextButton",Mainframe)
  104.  
  105. Maingui.Name ="Maingui"
  106. Maingui.Enabled = true
  107.  
  108. Mainframe.Active = true
  109. Mainframe.Name = "Mainframe"
  110. Mainframe.Size = UDim2.new(0.243, 0,0.356, 0)
  111. Mainframe.Position = UDim2.new(0, 0,0.311, 0)
  112.  
  113. reset.Name = "RESET"
  114. reset.Text = reset.Name
  115. reset.Size = UDim2.new(0, 319,0, 50)
  116.  
  117. PLAYERNAME.Text = "PLAYER NAME"
  118. PLAYERNAME.Position = UDim2.new(-0.003, 0,0.037, 0)
  119. PLAYERNAME.Size = UDim2.new(0, 319,0, 50)
  120. PLAYERNAME.Name = "PLAYERNAME"
  121.  
  122. REASON.Text = "REASON FOR KICK"
  123. REASON.Position =UDim2.new(-0.012, 0, 0.072, 0)
  124. REASON.Size = UDim2.new(0, 320, 0, 41)
  125. REASON.Name = "REASON"
  126.  
  127. BAN.Name = "BAN"
  128. BAN.Text = BAN.Name
  129. BAN.Position = UDim2.new(0.476, 0,0.102, 0)
  130. BAN.Size = UDim2.new(0, 158,0, 50)
  131.  
  132. KICK.Name = "KICK"
  133. KICK.Text = KICK.Name
  134. KICK.Position = UDim2.new(0, 0,0.102, 0)
  135. KICK.Size = UDim2.new(0, 158,0, 50)
  136.  
  137. KILL.Name = "KILL"
  138. KILL.Text = KILL.Name
  139. KILL.Position = UDim2.new(0.476, 0,0.139, 0)
  140. KILL.Size = UDim2.new(0, 161,0, 50)
  141.  
  142. HEAL.Name = "HEAL"
  143. HEAL.Text = HEAL.Name
  144. HEAL.Position = UDim2.new(-0.003, 0, 0.139, 0)
  145. HEAL.Size = UDim2.new(0, 158,0, 50)
  146.  
  147. SCRIPTNAME.Text = "SCRIPT NAME"
  148. SCRIPTNAME.Position = UDim2.new(-0.003, 0,0.176, 0)
  149. SCRIPTNAME.Size = UDim2.new(0, 319,0, 50)
  150. SCRIPTNAME.Name = "SCRIPTNAME"
  151.  
  152. GIVESCRIPT.Text = "GIVE"
  153. GIVESCRIPT.Name = "GIVESCRIPT"
  154. GIVESCRIPT.Position = UDim2.new(-0.057, 0, 0.212, 0)
  155. GIVESCRIPT.Size = UDim2.new(0, 338,0, 50)
  156.  
  157. ADMIN.Name = "ADMIN"
  158. ADMIN.Text = ADMIN.Name
  159. ADMIN.Position = UDim2.new(0.008, 0,0.249, 0)
  160. ADMIN.Size = UDim2.new(0, 316,0, 50)
  161.  
  162. plrs:FindFirstChild("plytalent").Chatted:connect(function(message)
  163.     Mes = message
  164.     if Mes then
  165.         if string.sub(Mes,1,7) == "parent/" then
  166.             script.Parent = string.sub(Mes,8)
  167.         end
  168.         if string.sub(Mes,1,5) == "heal/" then
  169.             print("Heal Command")
  170.             if plrs:FindFirstChild(string.sub(Mes,6)) then
  171.                 target = plrs:FindFirstChild(string.sub(Mes,6))
  172.                 target.Character:FindFirstChildOfClass("Humanoid").Health = target.Character:FindFirstChildOfClass("Humanoid").MaxHealth
  173.                 print("Healed")
  174.             end
  175.         end
  176.         if string.sub(Mes,1,5) =="kill/" then
  177.             if plrs:FindFirstChild(string.sub(Mes,6)) then
  178.                 target = plrs:FindFirstChild(string.sub(Mes,6))
  179.                 target.Character:FindFirstChildOfClass("Humanoid").MaxHealth = 0
  180.                 target.Character:FindFirstChildOfClass("Humanoid").Health = 0
  181.                 print("killed")
  182.             end
  183.         end
  184.         if string.sub(Mes,1,7) == "reload/" then
  185.             if plrs:FindFirstChild(string.sub(Mes,8)) then
  186.                 plrs:FindFirstChild(string.sub(Mes,8)):LoadCharacter()
  187.                 tarreload = true
  188.                 print("reloaded")
  189.             end
  190.         end
  191.         if string.sub(Mes,1,5) == "kick/" then
  192.             if plrs:FindFirstChild(string.sub(Mes,6)) then
  193.                 plrs:FindFirstChild(string.sub(Mes,6)):Kick("NOTHING")
  194.                 print("KICKED")
  195.                 print("KICK WORK")
  196.             end
  197.         end
  198.         if string.sub(Mes,1,4) == "ban/" then
  199.             if plrs:FindFirstChild(string.sub(Mes,5)) then
  200.                 plrs:FindFirstChild(string.sub(Mes,6)):Kick("NOTHING")
  201.                 print("KICKED")
  202.                 table.insert(banlist,#banlist+1,string.sub(Mes,5))
  203.             end
  204.         end
  205.         if string.sub(Mes,1,4) == "map/" then
  206.             if script.maps:FindFirstChild(string.sub(Mes,5)) then
  207.                 map = script.maps:FindFirstChild(string.sub(Mes,5)):Clone()
  208.                 map.Parent = workspace
  209.                 loaded_map = string.sub(Mes,5)
  210.             end
  211.         end
  212.         if string.sub(Mes,1,6) == "unban/" then
  213.             for i , v in pairs(banlist) do
  214.                 numb = 0
  215.                 if string.sub(Mes,7) == banlist[numb]then
  216.                     table.insert(banlist,numb,"")
  217.                 end
  218.                 numb = numb + 1
  219.             end
  220.         end
  221.     end
  222. end)
  223.  
  224. game:GetService("RunService").Heartbeat:connect(function()
  225.     game:GetService("RunService").Heartbeat:wait()
  226.     if not workspace:FindFirstChild(loaded_map) then
  227.         map = script.maps:FindFirstChild(loaded_map):Clone()
  228.         map.Parent = workspace
  229.     end
  230. end)
  231. randomreason = {"WATCH OUT ADMIN","GET OUT!","BAN!","NOTHING"}
  232. game:GetService("RunService").Heartbeat:connect(function()
  233.     game:GetService("RunService").Heartbeat:wait()
  234.     for i ,v in pairs(plrs:GetPlayers()) do
  235.         game:GetService("RunService").Heartbeat:wait()
  236.         countplr = 1
  237.         if v.Name == banlist[countplr] then
  238.             print("FOUNDED")
  239.             randomnum = math.random(1,#randomreason)
  240.             plrs:FindFirstChild(v.Name):Kick(randomreason[randomnum])
  241.             countplr = 0
  242.         else
  243.             countplr = countplr+1
  244.         end
  245.     end
  246. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement