Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
1,479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. wait(.5)
  2. script.Parent = nil
  3. Settings = {
  4. NumParts =20;
  5. Spacing = 0;
  6. Height = 5;
  7. SizeZ = .1;
  8. }
  9. MainParts = {}
  10.  
  11. for i=1,Settings.NumParts do
  12. local Part = Instance.new("Part")
  13. Part.Anchored = true
  14. Part.Material='Neon'
  15. Part.Size = Vector3.new(1,.1,1)
  16. Part.CanCollide = false
  17. Part.TopSurface = 10
  18. Part.BottomSurface = 10
  19. Part.FrontSurface = 10
  20. Part.BackSurface = 10
  21. Part.LeftSurface = 10
  22. Part.RightSurface = 10
  23. local PM = Instance.new("BlockMesh",Part)
  24. PM.Name = "Mesh"
  25. PM.Scale = Part.Size
  26. if MainParts[1] then
  27. Part.Parent = MainParts[1]
  28. Part.CFrame = game.Players.LocalPlayer.Character.Head.CFrame
  29. else
  30. Part.Parent = game.Players.LocalPlayer.Character
  31. Part.CFrame = game.Players.LocalPlayer.Character.Head.CFrame
  32. end
  33. table.insert(MainParts,#MainParts+1,Part)
  34. end
  35. insertsound = Instance.new("Sound")
  36. insertsound.Looped = true
  37. insertsound.Name = "AYEE"
  38. insertsound.MaxDistance = 100
  39. insertsound.EmitterSize = math.huge
  40. insertsound.Volume = 5
  41. insertsound.Pitch = 1
  42. --insertsound.SoundId = "http://www.roblox.com/asset?id=574539049"
  43. insertsound.SoundId = "http://www.roblox.com/asset?id=570556587"
  44. insertsound.Parent = game.Players.LocalPlayer.Character
  45. insertsound:Play()
  46. game:GetService'RunService'.RenderStepped:connect(function()
  47. local function UpdateColor()
  48. MainParts[1].Changed:connect(function()
  49. end)
  50. for i = 2,#MainParts do
  51. MainParts[i].BrickColor = MainParts[i-1].BrickColor
  52. wait()
  53. end
  54. end
  55. pcall(function()
  56. MainParts[1].Mesh.Scale = MainParts[1].Mesh.Scale:lerp(Vector3.new(1,insertsound.PlaybackLoudness/10,Settings.SizeZ),.5)
  57. MainParts[1].CFrame = MainParts[1].CFrame:lerp(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new((#MainParts/2-1) + (#MainParts*Settings.Spacing/2),Settings.Height,2),.9)
  58. if insertsound.PlaybackLoudness >= 350 then
  59. MainParts[1].BrickColor = BrickColor.Random()
  60. UpdateColor()
  61. end
  62. for i = 2,#MainParts do
  63. local Size = (MainParts[i-1]).Mesh.Scale.Y
  64. MainParts[i].Mesh.Scale = MainParts[i].Mesh.Scale:lerp(Vector3.new(1,Size,Settings.SizeZ),.9)
  65. local Offset = -(1 + Settings.Spacing)
  66. MainParts[i].CFrame = MainParts[i].CFrame:lerp((MainParts[i-1].CFrame * CFrame.new(Offset,0,0)),.8)
  67. end
  68. end)
  69. end)
  70.  
  71.  
  72. game.Players.LocalPlayer.Chatted:connect(function(msg)
  73. print(msg)
  74. if msg:lower():sub(1,#'add') == 'add' then
  75. local function AddParts()
  76. for i=1,tonumber(msg:sub(#'add '+1)) do
  77. local Part = Instance.new("Part")
  78. Part.Anchored = true
  79. Part.Material='Neon'
  80. Part.Size = Vector3.new(1,.1,1)
  81. Part.CanCollide = false
  82. Part.TopSurface = 10
  83. Part.BottomSurface = 10
  84. Part.FrontSurface = 10
  85. Part.BackSurface = 10
  86. Part.LeftSurface = 10
  87. Part.RightSurface = 10
  88. Part.Parent = MainParts[1]
  89. Part.CFrame = MainParts[#MainParts].CFrame
  90. local PM = Instance.new("BlockMesh",Part)
  91. PM.Name = "Mesh"
  92. PM.Scale = Part.Size
  93. table.insert(MainParts,#MainParts+1,Part)
  94. wait()
  95. end
  96. print(#MainParts)
  97. end
  98. AddParts()
  99. end
  100. if msg:lower():sub(1,#'remove') == 'remove' then
  101. for i=1,tonumber(msg:sub(#'remove '+1)) do
  102. local Part = MainParts[#MainParts]
  103. Part:Remove()
  104. table.remove(MainParts,#MainParts)
  105. wait()
  106. end
  107. print(#MainParts)
  108. end
  109. if msg:lower():sub(1,#'total') == 'total' then
  110. print(#MainParts)
  111. end
  112. if msg:lower():sub(1,#'play') == 'play' then
  113. insertsound.SoundId = "http://www.roblox.com/asset?id="..tonumber(msg:sub(#'play '+1))
  114. end
  115. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement