SHARE
TWEET

?????

Marcusbob111 Nov 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Players = game:GetService("Players")
  2.  
  3. local kickCommand = "/kick "
  4.  
  5. local function onOwnerChatted(player, message)
  6.     if message:sub(1, kickCommand:len()):lower() == kickCommand:lower() then
  7.         local name = message:sub(kickCommand:len() + 1)
  8.         local playerToKick = Players:FindFirstChild(name)
  9.         if playerToKick then
  10.             playerToKick:Kick("You have been kick by the owner.")
  11.         else
  12.             -- Couldn't find the player in question
  13.         end
  14.     end
  15. end
  16.  
  17. local function onPlayerAdded(player)
  18.     -- Restrict this command to only the creator/owner
  19.     if player.UserId == game.CreatorId and game.CreatorType == Enum.CreatorType.User then
  20.         player.Chatted:Connect(function (...)
  21.             onOwnerChatted(player, ...)
  22.         end)
  23.     end
  24. end
  25.  
  26. -- Listen for players being added
  27. for _, player in pairs(Players:GetPlayers()) do
  28.     onPlayerAdded(player)
  29. end
  30. Players.PlayerAdded:Connect(onPlayerAdded)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top