Aquarius_Raverus

Script

Dec 20th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.84 KB | None | 0 0
  1. -- By Aqu_ia, 2019
  2. -- SERVER
  3.  
  4.  
  5. --|| Variables
  6.  
  7.  
  8. local RStorage = game:GetService("ReplicatedStorage")
  9.  
  10.  
  11. repeat wait(2)
  12.    
  13.     local Folder = Instance.new("Folder", RStorage)
  14.  
  15.     Folder.Name = "AdminRemotesFolder"
  16.    
  17. until RStorage:FindFirstChild("AdminRemotesFolder")
  18.  
  19.  
  20. --|| Functions
  21.  
  22.  
  23. function AddRemote(kind, name)
  24.     if kind == "RemoteEvent" then
  25.         local NewRemote = Instance.new("RemoteEvent", RStorage:FindFirstChild("AdminRemotesFolder"))
  26.        
  27.         NewRemote.Name = name
  28.     end
  29. end
  30.  
  31. --|| Execution
  32.  
  33.  
  34. AddRemote("RemoteEvent", "TeleportEvent")
  35. AddRemote("RemoteEvent", "KickEvent")
  36. AddRemote("RemoteEvent", "BanEvent")
  37. AddRemote("RemoteEvent", "AnnounceEvent")
  38.  
  39.  
  40. RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('TeleportEvent').OnServerEvent:Connect(function(plr, target)
  41.     if plr.Name == target then
  42.         warn'You can not teleport to yourself!'
  43.     elseif game.Players:FindFirstChild(target) then
  44.         local currentPlayer = game.Workspace:FindFirstChild(plr.Name)
  45.         local targetPlayer = game.Workspace:FindFirstChild(target)
  46.        
  47.         if currentPlayer and currentPlayer.HumanoidRootPart then
  48.             currentPlayer:MoveTo(targetPlayer.Head.Position + Vector3.new(0,2,0))
  49.         end
  50.     end
  51. end)
  52.  
  53. RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('KickEvent').OnServerEvent:Connect(function(plr, target)
  54.     if plr.Name == target then
  55.         warn'You can not kick yourself!'
  56.     elseif game.Players:FindFirstChild(target) then
  57.         game.Players:FindFirstChild(target):Kick('Youve been kicked by '.. plr.Name.. " for exploiting!")
  58.     end
  59. end)
  60.  
  61. RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('BanEvent').OnServerEvent:Connect(function(plr, target)
  62.     if plr.Name == target then
  63.         warn'You can not ban yourself!'
  64.     elseif game.Players:FindFirstChild(target) then
  65.         game.Players:FindFirstChild(target):Kick('Youve been banned by '.. plr.Name.. " for exploiting!")
  66.     end
  67. end)
  68.  
  69. RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent').OnServerEvent:Connect(function(plr, msg)
  70.     if msg ~= nil then
  71.         RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent'):FireAllClients(msg, plr)
  72.     end
  73. end)
  74.  
  75.  
  76.  
  77. ---------------------------------------------------------------------------------------------------------------------------------------
  78.  
  79. -- By Aqu_ia, 2019
  80. -- CLIENT
  81.  
  82.  
  83. --|| Variables
  84.  
  85.  
  86. local RStorage = game:GetService("ReplicatedStorage")
  87.  
  88. local AdminPanel = script.Parent
  89.  
  90. local OpenPanelButton = AdminPanel.OpenPanel
  91. local MainFrame = AdminPanel.MainFrame
  92. local CommandsList = MainFrame.CommandsList
  93. local CommandsList2 = MainFrame.CommandsList2
  94.  
  95. local BackPage = MainFrame.BackPage
  96. local NextPage = MainFrame.NextPage
  97.  
  98. local BanFrame = CommandsList.Ban
  99. local TeleportFrame = CommandsList.TeleportTo
  100. local KickFrame = CommandsList.Kick
  101. local AnnounceFrame = CommandsList2.Announce
  102. local AnnouncementFrame = MainFrame.AnnounceFrame
  103.  
  104.  
  105. --|| Functions
  106.  
  107.  
  108. function OpenPanelClicked()
  109.     local Open = false
  110.     local ActivationDebounce = false
  111.    
  112.     OpenPanelButton.Open.MouseButton1Click:Connect(function()
  113.         if ActivationDebounce then return end
  114.        
  115.         if Open == false then
  116.             MainFrame:TweenPosition(UDim2.new(0.5,0,0.499,0))
  117.             Open = true
  118.             ActivationDebounce = true
  119.             wait(1)
  120.             ActivationDebounce = false
  121.         elseif Open == true then
  122.             MainFrame:TweenPosition(UDim2.new(1.5,0,0.499,0))
  123.             Open = false
  124.             ActivationDebounce = true
  125.             wait(1)
  126.             ActivationDebounce = false
  127.         end
  128.     end)
  129. end
  130.  
  131.  
  132. function NextPageClicked()
  133.     NextPage.MouseButton1Click:Connect(function()
  134.         for i,v in pairs(CommandsList:GetChildren()) do
  135.             v.Visible = false
  136.         end
  137.        
  138.         NextPage.Visible = false
  139.         BackPage.Visible = true
  140.        
  141.         for i,v in pairs(CommandsList2:GetChildren()) do
  142.             v.Visible = true
  143.         end
  144.     end)
  145. end
  146.  
  147.  
  148. function BackPageClicked()
  149.     BackPage.MouseButton1Click:Connect(function()
  150.         for i,v in pairs(CommandsList2:GetChildren()) do
  151.             v.Visible = false
  152.         end
  153.        
  154.         NextPage.Visible = true
  155.         BackPage.Visible = false
  156.        
  157.         for i,v in pairs(CommandsList:GetChildren()) do
  158.             v.Visible = true
  159.         end
  160.     end)
  161. end
  162.  
  163. function TeleporToClicked()
  164.     TeleportFrame.Submit.Submit.MouseButton1Click:Connect(function()
  165.         if game.Players:FindFirstChild(TeleportFrame.TextBox.TextBox.Text) then
  166.             RStorage:WaitForChild("AdminRemotesFolder").TeleportEvent:FireServer(TeleportFrame.TextBox.TextBox.Text)
  167.         else
  168.             TeleportFrame.TextBox.TextBox.Text = "Player could not be found!"
  169.             TeleportFrame.TextBox.TextBox.Text = ""
  170.             TeleportFrame.TextBox.TextBox.PlaceholderText.Text = "Type in Player Name"
  171.         end
  172.     end)
  173. end
  174.  
  175.  
  176. function KickedClicked()
  177.     KickFrame.Submit.Submit.MouseButton1Click:Connect(function()
  178.         if game.Players:FindFirstChild(KickFrame.TextBox.TextBox.Text) then        
  179.             RStorage:WaitForChild("AdminRemotesFolder").KickEvent:FireServer(KickFrame.TextBox.TextBox.Text)
  180.         else
  181.             KickFrame.TextBox.TextBox.Text = "Player could not be found!"
  182.             wait(2)
  183.             KickFrame.TextBox.TextBox.Text = ""
  184.             KickFrame.TextBox.TextBox.PlaceholderText = "Type in Player Name"
  185.         end
  186.     end)
  187. end
  188.  
  189.  
  190. function BanClicked()
  191.     BanFrame.Submit.Submit.MouseButton1Click:Connect(function()
  192.         if game.Players:FindFirstChild(BanFrame.TextBox.TextBox.Text) then         
  193.             RStorage:WaitForChild("AdminRemotesFolder").BanEvent:FireServer(BanFrame.TextBox.TextBox.Text)
  194.         else
  195.             BanFrame.TextBox.TextBox.Text = "Player could not be found!"
  196.             wait(2)
  197.             BanFrame.TextBox.TextBox.Text = ""
  198.             BanFrame.TextBox.TextBox.PlaceholderText = "Type in Player Name"
  199.         end
  200.     end)
  201. end
  202.  
  203.  
  204. function AnnounceClicked()
  205.     AnnounceFrame.Submit.Submit.MouseButton1Click:Connect(function()
  206.         RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent'):FireServer(AnnounceFrame.TextBox.TextBox.Text)
  207.     end)
  208. end
  209.  
  210. --|| Execution
  211.  
  212.  
  213.  
  214. OpenPanelClicked()
  215.  
  216.  
  217. BackPageClicked()
  218. NextPageClicked()
  219. AnnounceClicked()
  220. TeleporToClicked()
  221. KickedClicked()
  222. BanClicked()
Advertisement
Add Comment
Please, Sign In to add comment