Advertisement
Blueisim

Kick/Ban/Kill

Sep 3rd, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. print("Ready. Are you running this as a GlobalScript?")
  2. print("Usage:")
  3. print("cmds;")
  4. local ban={}
  5. local plr=game.Players.COOLBRAYDENNOOB --put ur name here m8
  6. local name
  7. function ban(t)
  8. if not t==plr.Name then
  9. table.insert(ban,1,t)
  10. end
  11. end
  12. function kick(who,why)
  13. who:Kick(why)
  14. end
  15. function kill(who)
  16. if game.Players:FindFirstChild(who) then
  17. game.Players:FindFirstChild(who).Character.Torso:Destroy()
  18. end
  19. end
  20. plr.Chatted:connect(function(m)
  21. print("He chatted!")
  22. if string.sub(m,1,5):lower()=="cmds;" and string.sub(m,5,string.len(m)) then
  23. print("Commands:")
  24. print("ban;")
  25. print("kick;")
  26. print("kill;")
  27. end
  28. if string.sub(m,1,4):lower()=="ban;" and string.sub(m,5,string.len(m)) then
  29. print"He banned someone."
  30. local num=string.sub(m,5,string.len(m))
  31. local targ=game.Players:FindFirstChild(num)
  32. name=targ.Name
  33. ban(name)
  34. kick(targ,"You have been kicked from this game.")
  35. elseif string.sub(m,1,5):lower()=="kill;" and string.sub(m,5,string.len(m)) then
  36. if game.Workspace:FindFirstChild(string.sub(m,5,string.len(m))) then
  37. game.Workspace:FindFirstChild(string.sub(m,5,string.len(m))).Torso:Destroy()
  38. elseif string.sub(m,1,4):lower()=="kick;" and string.sub(m,5,string.len(m)) then
  39. kick(game.Workspace:FindFirstChild(string.sub(m,5,string.len(m)),"Kicked.")
  40. end
  41. end
  42. end)
  43. game.Players.PlayerAdded:connect(function(p)
  44. for i=1,#ban do
  45. if p.Name==ban[i] then
  46. kick(p,"You are on banlist.")
  47. end
  48. end
  49. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement