Advertisement
Vexera2

Untitled

Mar 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. local Admins = {["516805490"] = true}
  2. local prefix = ";"
  3.  
  4. local commandTable = {}
  5.  
  6. function findPlayer(name)
  7. for _, player in ipairs(game.Players:GetPlayers()) do
  8. if player.Name:lower() == name:lower() then
  9. return player
  10. end
  11. end
  12. end
  13.  
  14. -- Kill command
  15. function commandTable.block(message, player)
  16. victim = findPlayer(message)
  17. if victim and victim.Character then
  18. victim.Character:Destroy()
  19. end
  20. end
  21.  
  22. -- Kick command
  23. function commandTable.kick(message, player)
  24. victim = findPlayer(message)
  25. if victim and victim.Character then
  26. victim:Kick("[Kick]: "..player.Name.." has kicked you from the game!")
  27. end
  28. end
  29.  
  30. game.Players.PlayerAdded:Connect(function(player)
  31. if Admins[tostring(player.UserId)] then
  32. player.Chatted:Connect(function(message)
  33. local command, argument = message:match(prefix.."(.+) (.+)")
  34. if command and commandTable[command] then
  35. commandTable[command](argument, player)
  36. end
  37. end)
  38. end
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement