Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create the Screen GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "KickGUI"
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Create the main frame
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 300, 0, 200)
- mainFrame.Position = UDim2.new(0.5, -150, 0.5, -100)
- mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- mainFrame.Parent = screenGui
- -- Create Player text box
- local playerTextBox = Instance.new("TextBox")
- playerTextBox.Size = UDim2.new(0, 200, 0, 50)
- playerTextBox.Position = UDim2.new(0, 50, 0, 10)
- playerTextBox.PlaceholderText = "Player"
- playerTextBox.Parent = mainFrame
- -- Create Reason text box
- local reasonTextBox = Instance.new("TextBox")
- reasonTextBox.Size = UDim2.new(0, 200, 0, 50)
- reasonTextBox.Position = UDim2.new(0, 50, 0, 70)
- reasonTextBox.PlaceholderText = "Reason"
- reasonTextBox.Parent = mainFrame
- -- Create Kick button
- local kickButton = Instance.new("TextButton")
- kickButton.Size = UDim2.new(0, 100, 0, 50)
- kickButton.Position = UDim2.new(0, 100, 0, 130)
- kickButton.Text = "Kick"
- kickButton.Parent = mainFrame
- -- Create Kick All button
- local kickAllButton = Instance.new("TextButton")
- kickAllButton.Size = UDim2.new(0, 100, 0, 50)
- kickAllButton.Position = UDim2.new(0, 200, 0, 130)
- kickAllButton.Text = "Kick All"
- kickAllButton.Parent = mainFrame
- -- Kick button functionality
- kickButton.MouseButton1Click:Connect(function()
- local playerName = playerTextBox.Text
- local reason = reasonTextBox.Text
- -- Find the player and kick them
- local player = game.Players:FindFirstChild(playerName)
- if player then
- player:Kick(reason)
- else
- print("Player not found")
- end
- end)
- -- Kick All button functionality
- kickAllButton.MouseButton1Click:Connect(function()
- local reason = reasonTextBox.Text
- -- Kick all players
- for _, player in pairs(game.Players:GetPlayers()) do
- if player ~= game.Players.LocalPlayer then -- Avoid kicking yourself
- player:Kick(reason)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement