Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By Aqu_ia, 2019
- -- SERVER
- --|| Variables
- local RStorage = game:GetService("ReplicatedStorage")
- repeat wait(2)
- local Folder = Instance.new("Folder", RStorage)
- Folder.Name = "AdminRemotesFolder"
- until RStorage:FindFirstChild("AdminRemotesFolder")
- --|| Functions
- function AddRemote(kind, name)
- if kind == "RemoteEvent" then
- local NewRemote = Instance.new("RemoteEvent", RStorage:FindFirstChild("AdminRemotesFolder"))
- NewRemote.Name = name
- end
- end
- --|| Execution
- AddRemote("RemoteEvent", "TeleportEvent")
- AddRemote("RemoteEvent", "KickEvent")
- AddRemote("RemoteEvent", "BanEvent")
- AddRemote("RemoteEvent", "AnnounceEvent")
- RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('TeleportEvent').OnServerEvent:Connect(function(plr, target)
- if plr.Name == target then
- warn'You can not teleport to yourself!'
- elseif game.Players:FindFirstChild(target) then
- local currentPlayer = game.Workspace:FindFirstChild(plr.Name)
- local targetPlayer = game.Workspace:FindFirstChild(target)
- if currentPlayer and currentPlayer.HumanoidRootPart then
- currentPlayer:MoveTo(targetPlayer.Head.Position + Vector3.new(0,2,0))
- end
- end
- end)
- RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('KickEvent').OnServerEvent:Connect(function(plr, target)
- if plr.Name == target then
- warn'You can not kick yourself!'
- elseif game.Players:FindFirstChild(target) then
- game.Players:FindFirstChild(target):Kick('Youve been kicked by '.. plr.Name.. " for exploiting!")
- end
- end)
- RStorage:WaitForChild('AdminRemotesFolder'):WaitForChild('BanEvent').OnServerEvent:Connect(function(plr, target)
- if plr.Name == target then
- warn'You can not ban yourself!'
- elseif game.Players:FindFirstChild(target) then
- game.Players:FindFirstChild(target):Kick('Youve been banned by '.. plr.Name.. " for exploiting!")
- end
- end)
- RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent').OnServerEvent:Connect(function(plr, msg)
- if msg ~= nil then
- RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent'):FireAllClients(msg, plr)
- end
- end)
- ---------------------------------------------------------------------------------------------------------------------------------------
- -- By Aqu_ia, 2019
- -- CLIENT
- --|| Variables
- local RStorage = game:GetService("ReplicatedStorage")
- local AdminPanel = script.Parent
- local OpenPanelButton = AdminPanel.OpenPanel
- local MainFrame = AdminPanel.MainFrame
- local CommandsList = MainFrame.CommandsList
- local CommandsList2 = MainFrame.CommandsList2
- local BackPage = MainFrame.BackPage
- local NextPage = MainFrame.NextPage
- local BanFrame = CommandsList.Ban
- local TeleportFrame = CommandsList.TeleportTo
- local KickFrame = CommandsList.Kick
- local AnnounceFrame = CommandsList2.Announce
- local AnnouncementFrame = MainFrame.AnnounceFrame
- --|| Functions
- function OpenPanelClicked()
- local Open = false
- local ActivationDebounce = false
- OpenPanelButton.Open.MouseButton1Click:Connect(function()
- if ActivationDebounce then return end
- if Open == false then
- MainFrame:TweenPosition(UDim2.new(0.5,0,0.499,0))
- Open = true
- ActivationDebounce = true
- wait(1)
- ActivationDebounce = false
- elseif Open == true then
- MainFrame:TweenPosition(UDim2.new(1.5,0,0.499,0))
- Open = false
- ActivationDebounce = true
- wait(1)
- ActivationDebounce = false
- end
- end)
- end
- function NextPageClicked()
- NextPage.MouseButton1Click:Connect(function()
- for i,v in pairs(CommandsList:GetChildren()) do
- v.Visible = false
- end
- NextPage.Visible = false
- BackPage.Visible = true
- for i,v in pairs(CommandsList2:GetChildren()) do
- v.Visible = true
- end
- end)
- end
- function BackPageClicked()
- BackPage.MouseButton1Click:Connect(function()
- for i,v in pairs(CommandsList2:GetChildren()) do
- v.Visible = false
- end
- NextPage.Visible = true
- BackPage.Visible = false
- for i,v in pairs(CommandsList:GetChildren()) do
- v.Visible = true
- end
- end)
- end
- function TeleporToClicked()
- TeleportFrame.Submit.Submit.MouseButton1Click:Connect(function()
- if game.Players:FindFirstChild(TeleportFrame.TextBox.TextBox.Text) then
- RStorage:WaitForChild("AdminRemotesFolder").TeleportEvent:FireServer(TeleportFrame.TextBox.TextBox.Text)
- else
- TeleportFrame.TextBox.TextBox.Text = "Player could not be found!"
- TeleportFrame.TextBox.TextBox.Text = ""
- TeleportFrame.TextBox.TextBox.PlaceholderText.Text = "Type in Player Name"
- end
- end)
- end
- function KickedClicked()
- KickFrame.Submit.Submit.MouseButton1Click:Connect(function()
- if game.Players:FindFirstChild(KickFrame.TextBox.TextBox.Text) then
- RStorage:WaitForChild("AdminRemotesFolder").KickEvent:FireServer(KickFrame.TextBox.TextBox.Text)
- else
- KickFrame.TextBox.TextBox.Text = "Player could not be found!"
- wait(2)
- KickFrame.TextBox.TextBox.Text = ""
- KickFrame.TextBox.TextBox.PlaceholderText = "Type in Player Name"
- end
- end)
- end
- function BanClicked()
- BanFrame.Submit.Submit.MouseButton1Click:Connect(function()
- if game.Players:FindFirstChild(BanFrame.TextBox.TextBox.Text) then
- RStorage:WaitForChild("AdminRemotesFolder").BanEvent:FireServer(BanFrame.TextBox.TextBox.Text)
- else
- BanFrame.TextBox.TextBox.Text = "Player could not be found!"
- wait(2)
- BanFrame.TextBox.TextBox.Text = ""
- BanFrame.TextBox.TextBox.PlaceholderText = "Type in Player Name"
- end
- end)
- end
- function AnnounceClicked()
- AnnounceFrame.Submit.Submit.MouseButton1Click:Connect(function()
- RStorage:WaitForChild("AdminRemotesFolder"):WaitForChild('AnnounceEvent'):FireServer(AnnounceFrame.TextBox.TextBox.Text)
- end)
- end
- --|| Execution
- OpenPanelClicked()
- BackPageClicked()
- NextPageClicked()
- AnnounceClicked()
- TeleporToClicked()
- KickedClicked()
- BanClicked()
Advertisement
Add Comment
Please, Sign In to add comment