Advertisement
ajcooper2003

Untitled

Sep 21st, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. Commands:
  2.  
  3. hat/NumberHere to create number of hats
  4. Say disperse to take them off
  5. attack/Player Self Explanatory.
  6. attack/rocket/Player Also self explanatory
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. me = game.Players.ajcooper1
  15. function onChatted(msg)
  16. msg = msg
  17. if string.match(msg, "hat/") then
  18. p = game.Workspace.ajcooper1:GetChildren()
  19. for n = 1,#p do
  20. for w in string.gmatch(msg, "%d+") do
  21. if (p[n].className == "Hat") then
  22. for i = 1,w do
  23. wait(0.05)
  24. t = p[n].Handle:clone()
  25. t.Parent = game.Workspace
  26. t.CanCollide = true
  27. t.Anchored = false
  28. t.Position = me.Character.Torso.Position
  29. t.Name = "HatRocket"
  30. local rp = Instance.new("RocketPropulsion")
  31. rp.Parent = t
  32. rp.Target = me.Character.Head
  33. rp.MaxSpeed = 20000
  34. rp:Fire()
  35. end
  36. end
  37. end
  38. end
  39. end
  40. if string.match(msg, "attack/") then
  41. players = game.Players:GetChildren()
  42. for i = 1,#players do
  43. if string.match(msg, string.lower(players[i].Name)) then
  44. p = game.Workspace:GetChildren()
  45. for n = 1,#p do
  46. if (p[n].Name == "HatRocket") then
  47. p[n].RocketPropulsion.Target = players[i].Character.Head
  48. end
  49. end
  50. end
  51. end
  52. end
  53. if string.match(msg, "attack/rocket/") then
  54. players = game.Players:GetChildren()
  55. for i = 1,#players do
  56. if string.match(msg, string.lower(players[i].Name)) then p = game.Workspace:GetChildren()
  57. for n = 1,#p do
  58. if (p[n].Name == "HatRocket") then
  59. p[n].RocketPropulsion.Target = players[i].Character.Head
  60. p[n].RocketPropulsion.CartoonFactor = 10
  61. p[n].RocketPropulsion.TargetRadius = 30
  62. function onBlown(hit)
  63. hit = p[n].RocketPropulsion.Target
  64. if (hit ~= nil) then
  65. local e = Instance.new("Explosion")
  66. e.Parent = hit.Parent
  67. e.BlastPressure = 9999
  68. e.Position = p[n].Position
  69. e.BlastRadius = 6
  70. wait(3)
  71. p[n]:remove()
  72. end
  73. end
  74. boom = p[n].RocketPropulsion.ReachedTarget:connect(onBlown)
  75. wait(5)
  76. boom:disconnect()
  77. end
  78. end
  79. end
  80. end
  81. end
  82. if (msg == "disperse") then
  83. local p = game.Workspace:GetChildren()
  84. for i = 1,#p do
  85. if (p[i].Name == "HatRocket") then
  86. p[i].RocketPropulsion.MaxSpeed = 200000
  87. local e = Instance.new("Explosion")
  88. e.Parent = game.Workspace
  89. e.Position = p[i].Position
  90. e.BlastPressure = 10
  91. p[i]:remove()
  92. end
  93. end
  94. end
  95. end
  96. me.Chatted:connect(onChatted)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement