Advertisement
Mech123454

Untitled

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