Advertisement
Imakerblxscripts55

Untitled

Sep 18th, 2024
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. -- Create the Screen GUI
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Name = "KickGUI"
  4. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  5.  
  6. -- Create the main frame
  7. local mainFrame = Instance.new("Frame")
  8. mainFrame.Size = UDim2.new(0, 300, 0, 200)
  9. mainFrame.Position = UDim2.new(0.5, -150, 0.5, -100)
  10. mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  11. mainFrame.Parent = screenGui
  12.  
  13. -- Create Player text box
  14. local playerTextBox = Instance.new("TextBox")
  15. playerTextBox.Size = UDim2.new(0, 200, 0, 50)
  16. playerTextBox.Position = UDim2.new(0, 50, 0, 10)
  17. playerTextBox.PlaceholderText = "Player"
  18. playerTextBox.Parent = mainFrame
  19.  
  20. -- Create Reason text box
  21. local reasonTextBox = Instance.new("TextBox")
  22. reasonTextBox.Size = UDim2.new(0, 200, 0, 50)
  23. reasonTextBox.Position = UDim2.new(0, 50, 0, 70)
  24. reasonTextBox.PlaceholderText = "Reason"
  25. reasonTextBox.Parent = mainFrame
  26.  
  27. -- Create Kick button
  28. local kickButton = Instance.new("TextButton")
  29. kickButton.Size = UDim2.new(0, 100, 0, 50)
  30. kickButton.Position = UDim2.new(0, 100, 0, 130)
  31. kickButton.Text = "Kick"
  32. kickButton.Parent = mainFrame
  33.  
  34. -- Create Kick All button
  35. local kickAllButton = Instance.new("TextButton")
  36. kickAllButton.Size = UDim2.new(0, 100, 0, 50)
  37. kickAllButton.Position = UDim2.new(0, 200, 0, 130)
  38. kickAllButton.Text = "Kick All"
  39. kickAllButton.Parent = mainFrame
  40.  
  41. -- Kick button functionality
  42. kickButton.MouseButton1Click:Connect(function()
  43. local playerName = playerTextBox.Text
  44. local reason = reasonTextBox.Text
  45.  
  46. -- Find the player and kick them
  47. local player = game.Players:FindFirstChild(playerName)
  48. if player then
  49. player:Kick(reason)
  50. else
  51. print("Player not found")
  52. end
  53. end)
  54.  
  55. -- Kick All button functionality
  56. kickAllButton.MouseButton1Click:Connect(function()
  57. local reason = reasonTextBox.Text
  58.  
  59. -- Kick all players
  60. for _, player in pairs(game.Players:GetPlayers()) do
  61. if player ~= game.Players.LocalPlayer then -- Avoid kicking yourself
  62. player:Kick(reason)
  63. end
  64. end
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement