Advertisement
kanewutt

efewefef

May 21st, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. -- Made By Thearmydevil
  2.  
  3.  
  4. print("Admin Script")
  5.  
  6. local adminList = {"iiCxnturies", "Lycketysplitz101", "phantomface", "halo2478", "dragonforce2499", "Tetra192001", "graycomander"}
  7. adminList["LordxRavenous"] = true
  8. adminList["Lycketysplitz101"] = true
  9. adminList["phantomface"] = true
  10. adminList["Tetra192001"] = true
  11. adminList["halo2478"] = true
  12. adminList["dragonforce2499"] = true
  13. adminList["graycomander"] = true
  14.  
  15. local banList = {}
  16. local commands = {"ban", "kick", "noobs"}
  17.  
  18. function rockOn(msg, player)
  19. if msg and player then
  20. print(msg)
  21. local delimiter = string.find(msg, "/")
  22. if delimiter then
  23. local command = string.sub(msg, 1, delimiter - 1)
  24. if game.Workspace:FindFirstChild("Debug") then
  25. game.Workspace.Debug.Value = command
  26. end
  27. local stringLength = string.len(msg)
  28. if command == "kick" then
  29. local playerName = string.sub(msg, delimiter + 1, stringLength)
  30. if game.Workspace:FindFirstChild("Debug") then
  31. game.Workspace.Debug.Value = playerName
  32. end
  33. local playerNameLength = string.len(playerName)
  34. local players = game.Players:GetChildren()
  35. for i = 1, #players do
  36. if string.lower(string.sub(players[i].Name, 1, playerNameLength)) == playerName and players[i] ~= player then
  37. players[i]:Remove()
  38. end
  39. end
  40. elseif command == "ban" then
  41. local playerName = string.sub(msg, delimiter + 1, stringLength)
  42. local playerNameLength = string.len(playerName)
  43. local players = game.Players:GetChildren()
  44. for i = 1, #players do
  45. if string.lower(string.sub(players[i].Name, 1, playerNameLength)) == playerName then
  46. table.insert(banList, player.Name)
  47. players[i]:Remove()
  48. end
  49. end
  50. elseif command == "noobs" then
  51. local players = game.Players:GetChildren()
  52. for i = 1, #players do
  53. -- This is tricky
  54. if players[i] and players[i]:FindFirstChild("leaderstats") then
  55. local stats = players[i].leaderstats
  56. if stats:FindFirstChild("Score") then
  57. if stats.Score.Value == 0 and not adminList[players[i].Name] then
  58. players[i]:Remove()
  59. end
  60. end
  61. end
  62. end
  63. end
  64. end
  65. end
  66. end
  67.  
  68.  
  69. game.Players.PlayerAdded:connect(function(player)
  70. print(player)
  71. for i = 1, #banList do
  72. if string.lower(banList[i]) == string.lower(player.Name) then
  73. player:Remove()
  74. end
  75. end
  76.  
  77. for i = 1, #adminList do
  78. if string.lower(adminList[i]) == string.lower(player.Name) then
  79. print("Found Admin")
  80. player.Chatted:connect(function(msg) rockOn(msg, player) end)
  81. end
  82. end
  83. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement