Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function kill(target)
  2. for i=1,#target do
  3. game.Players.target[i].Character:BreakJoints()
  4. end
  5. end
  6.  
  7. function isadmin(source)
  8. for i=1,#admins do
  9. if admins[i]:lower()==source:lower() then return true end
  10. end
  11. end
  12.  
  13. function findplayer(msg, source)
  14. people = {}
  15. c = game.Players:GetChildren()
  16. if msg:lower()=="me" then
  17. table.insert(people, source)
  18. return people
  19. elseif msg:lower()=="all" then
  20. for i=1,#c do
  21. table.insert(people, c[i])
  22. end
  23. return people
  24. else
  25. local length = msg:len()
  26. for i=1,#c do
  27. if c[i].Name:lower():sub(1, length)==msg:lower() then
  28. table.insert(people, c[i])
  29. end
  30. end
  31. return people
  32. end
  33. end
  34.  
  35. game.Players.PlayerAdded:connect(function(player)
  36. source = player.Name
  37. if isadmin(source) == true then
  38. player.Chatted:connect(function(msg, player)
  39. if msg:lower():sub(1,6)==":kill " then
  40. msg = msg:sub(7)
  41. target = findplayer(msg, source)
  42. kill(target)
  43. end
  44. end)
  45. end
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement