Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2.  
  3. local symbol = ":"
  4. -- can use any non-alphanumerical character as a sperater and the symbol
  5.  
  6. plr.Chatted:connect(function(msg)
  7. local t = {}
  8. if string.sub(msg,0,1) == symbol then -- if not it will just be nil
  9. for word in string.gmatch(msg, "%w+") do print(word) table.insert(t,string.lower(word)) end end
  10. t['cmd'] = t[1] -- i like saying cmd better then 1
  11.  
  12. if t['cmd'] == "speed" then
  13. for __,v in next, returnplayer(t[3]) do
  14. v.Character.Humanoid.WalkSpeed = t[2]
  15. end
  16. end
  17.  
  18. if t['cmd'] == 'sword' then
  19. for __,v in next, returnplayer(t[2]) do
  20. local a = game:service("InsertService"):LoadAsset(125013769)
  21. a.Parent = v.Backpack; a.Sword.Parent = v.Backpack; a:remove()
  22. end
  23. end
  24.  
  25. if t['cmd'] == 'heal' then
  26. for __,v in next, returnplayer(t[2]) do
  27. v.Character.Humanoid.Health = 100
  28. end
  29. end
  30.  
  31. if t['cmd'] == 'health' then
  32. for __,v in next, returnplayer(t[3]) do
  33. v.Character.Humanoid.Health = t[2]
  34. end
  35. end
  36.  
  37. if t['cmd'] == 'kill' then
  38. for __,v in next, returnplayer(t[2]) do
  39. v.Character.Humanoid.Health = 0
  40. end
  41. end
  42.  
  43. if t['cmd'] == 'god' then
  44. for __,v in next, returnplayer(t[2]) do
  45. v.Character.Humanoid.MaxHealth = math.huge
  46. end
  47. end
  48.  
  49. if t['cmd'] == 'ungod' then
  50. for __,v in next, returnplayer(t[2]) do
  51. v.Character.Humanoid.MaxHealth = 100
  52. v.Character.Humanoid.Health = 100
  53. end
  54. end
  55.  
  56. if t['cmd'] == 'ff' or t['cmd'] == 'forcefield' then
  57. for __,v in next, returnplayer(t[2]) do
  58. Instance.new('ForceField',v.Character)
  59. end
  60. end
  61.  
  62. if t['cmd'] == 'unff' or t['cmd'] == 'unforcefield' then
  63. for __,v in next, returnplayer(t[2]) do
  64. for __, x in next, v.Character:GetChildren() do
  65. if x.ClassName == 'ForceField' then x:remove() end
  66. end
  67. end
  68. end
  69.  
  70. end)
  71.  
  72. function returnplayer(varr) --could use elseifs, but im to lazy to do dat right naw
  73. local var = varr
  74. local plrs = {}
  75. if var == 'all' then for __,v in next, game.Players:GetChildren() do
  76. table.insert(plrs,v)
  77. end end
  78. if var == 'others' then
  79. for __,v in next, game.Players:GetChildren() do
  80. if v ~= plr then
  81. table.insert(plrs,v)
  82. end
  83. end
  84. end
  85. if var == 'me' then
  86. table.insert(plrs,plr)
  87. end
  88. return plrs
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement