Advertisement
DrawingJhon

Untitled

Jul 21st, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local remote = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
  2. remote.Name = "bruhremote"
  3. for _, player in pairs(game:GetService("Players"):GetChildren()) do
  4.     NLS([[local remote = game:GetService("ReplicatedStorage"):WaitForChild("bruhremote")
  5.     remote:FireServer("Started")
  6.     remote.OnClientEvent:Connect(function(data, reason)
  7.         if data == "kick" then
  8.             local success, err = pcall(function()
  9.                 game.Players.LocalPlayer:Kick(reason)
  10.             end)
  11.             if success then
  12.                 remote:FireServer("Kicked")
  13.             end
  14.         end
  15.     end)
  16.     ]], player.PlayerGui)
  17. end
  18. local plrs = {}
  19.  
  20. remote.OnServerEvent:Connect(function(plr, wht)
  21.     if wht == "Started" then
  22.         print(plr.Name.." accepts your localscript request!")
  23.         table.insert(plrs, plr)
  24.     end
  25.     if wht == "Kicked" then
  26.         print("Successfully kicked to "..plr.Name.."!")
  27.     end
  28. end)
  29.  
  30. owner.Chatted:Connect(function(msg)
  31.     if msg:lower():sub(1,3) == "/k " or msg:lower():sub(1,3) == "/e " then
  32.         for i = 1,#plrs do
  33.             local plr = plrs[i]
  34.             if plr.Name:lower():match('^'..msg:sub(4):lower()) and msg:sub(4) ~= "" then
  35.                 remote:FireClient(plrs[i], "kick", msg:sub(plrs[i].Name:len() + 4))
  36.             end
  37.         end
  38.     end
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement