iVixn

Untitled

Jan 15th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. rad = 11
  2. circ = 2*math.pi*rad
  3. n = circ/(rad/10)
  4. rot = 360/n
  5. startpoints = {}
  6. endpoints = {}
  7. plr = game.Players.LocalPlayer
  8. mouse = plr:GetMouse()
  9. chr = plr.Character or plr.CharacterAdded:wait()
  10. torso = chr.Torso
  11. renderstepped = game:GetService('RunService').RenderStepped
  12. model = Instance.new("Model")
  13. model.Parent = chr
  14. circle = Instance.new("Part",model)
  15. model.PrimaryPart = circle
  16. circle.Anchored = true
  17. circle.CFrame = CFrame.new(0,50,0)
  18. circle.CanCollide = false
  19. circle.BrickColor = BrickColor.new(Color3.fromRGB(192, 57, 43)) --BRICKCOLOR ONLY GOES TO 1 R(ED)G(REEN)B(LUE)
  20. circle.Size = Vector3.new(rad/30,rad/10,rad/30) --SIZE ONLY CHANGE THE MIDDLE
  21. circle.Transparency = 1 --VISIBILITY OF INSIDE BLOCK
  22. circle.Material = Enum.Material.Neon
  23.  
  24. userinput = game:GetService('UserInputService')
  25.  
  26. brickcolors = {
  27. BrickColor.new(Color3.fromRGB(52, 152, 219)),
  28. BrickColor.new(Color3.fromRGB(46, 204, 113)),
  29. BrickColor.new(Color3.fromRGB(26, 188, 156)),
  30. BrickColor.new(Color3.fromRGB(155, 89, 182)),
  31. BrickColor.new(Color3.fromRGB(241, 196, 15)),
  32. BrickColor.new(Color3.fromRGB(230, 126, 34)),
  33. BrickColor.new(Color3.fromRGB(192, 57, 43)),
  34. BrickColor.new(Color3.fromRGB(189, 195, 199)),
  35. BrickColor.new(Color3.fromRGB(52, 73, 94)),
  36. BrickColor.new(Color3.fromRGB(41, 128, 185)),
  37. BrickColor.new(Color3.fromRGB(142, 68, 173)),
  38. BrickColor.new(Color3.fromRGB(39, 174, 96)),
  39. BrickColor.new(Color3.fromRGB(22, 160, 133)),
  40. BrickColor.new(Color3.fromRGB(243, 156, 18)),
  41. BrickColor.new(Color3.fromRGB(211, 84, 0)),
  42. BrickColor.new(Color3.fromRGB(192, 57, 43)),
  43. }
  44.  
  45.  
  46. for i = 0,n/2 do
  47. renderstepped:wait()
  48. local clone = circle:Clone()
  49. local function tran()
  50. clone.Parent = model
  51. for index = .5,7,.1 do
  52. renderstepped:wait()
  53. -- clone.Size = Vector3.new(.5,index,.5)
  54. clone.Transparency = clone.Transparency - .05
  55. clone.CFrame = circle.CFrame*CFrame.Angles(0,0,math.rad(i*(rot*2)))*CFrame.new(rad/2.15,0,0)
  56. end
  57. end
  58. spawn(tran)
  59. end
  60. wait(1)
  61. children = model:GetChildren()
  62.  
  63. --function get_startpoints()
  64. -- for i,v in pairs(children) do
  65. -- if v~=circle then
  66. -- table.insert(startpoints,i,v.CFrame)
  67. -- end
  68. -- end
  69. --end
  70. --
  71. --function get_endpoints(cframeval)
  72. ---- rad = rad+(cframeval*2)
  73. -- for i,v in pairs(children) do
  74. -- if v ~= circle then
  75. -- table.insert(endpoints,i,v.CFrame*CFrame.new(cframeval,0,0))
  76. -- end
  77. -- end
  78. --end
  79.  
  80. function move(part,dist)
  81. for i = 0,10 do
  82. renderstepped:wait()
  83. part.CFrame = part.CFrame*CFrame.new(dist/10,0,0)
  84. end
  85. end
  86.  
  87. function lerp(dist)--how many studs
  88. rad = rad+(dist*2)
  89. for i = 0,10 do
  90. renderstepped:wait()
  91. for index,v in pairs(children) do
  92. if v ~= circle then
  93. v.Size = Vector3.new(rad/30,rad/10,rad/30)
  94. v.CFrame = v.CFrame*CFrame.new(dist/10,0,0)
  95. end
  96. end
  97. end
  98. end
  99.  
  100. function colorchange(color)
  101. for i,v in pairs(children) do
  102. renderstepped:wait()
  103. v.BrickColor = brickcolors[color]
  104. end
  105. end
  106.  
  107. x = 1
  108. y = 1
  109. z = 1
  110. xinc = 1
  111. yinc = 1.5
  112. zinc = -2
  113.  
  114. function rotation()
  115. while renderstepped:wait() do
  116. x = x+xinc
  117. y = y+yinc
  118. z = z-zinc
  119. model:SetPrimaryPartCFrame(CFrame.new(torso.Position)*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z)))
  120. end
  121. end
  122. spawn(rotation)
  123.  
  124. userinput.InputBegan:connect(function(keycode)
  125. local key = keycode.KeyCode
  126. if key == Enum.KeyCode.Q then
  127. lerp(2)
  128. colorchange(math.random(1,16))
  129. elseif key == Enum.KeyCode.E then
  130. lerp(-2)
  131. colorchange(math.random(1,16))
  132. elseif key == Enum.KeyCode.R then
  133. lerp(-rad)
  134. colorchange(math.random(1,16))
  135. elseif key == Enum.KeyCode.T then
  136. local randomA = math.random(1,16)
  137. local randomB = math.random(1,16)
  138. for i,v in pairs(children) do
  139. renderstepped:wait()
  140. if i/2 == math.ceil(i/2) then
  141. v.BrickColor = brickcolors[randomA]
  142. else
  143. v.BrickColor = brickcolors[randomB]
  144. end
  145. end
  146. elseif key == Enum.KeyCode.Y then
  147. for i,v in pairs(children) do
  148. renderstepped:wait()
  149. v.BrickColor = brickcolors[math.random(1,16)]
  150. end
  151. elseif key == Enum.KeyCode.F then
  152. xinc = xinc+1
  153. elseif key == Enum.KeyCode.Z then
  154. xinc = xinc-1
  155. elseif key == Enum.KeyCode.G then
  156. yinc = yinc+1
  157. elseif key == Enum.KeyCode.X then
  158. yinc = yinc-1
  159. elseif key == Enum.KeyCode.H then
  160. zinc = zinc+1
  161. elseif key == Enum.KeyCode.C then
  162. zinc = zinc-1
  163. elseif key == Enum.KeyCode.J then
  164. for i = 0,1,.1 do
  165. renderstepped:wait()
  166. for x,v in pairs(children) do
  167. if x/2 ~= math.ceil(x/2) then
  168. v.Transparency = i
  169. end
  170. end
  171. end
  172. elseif key == Enum.KeyCode.K then
  173. for i = 0,1,.1 do
  174. renderstepped:wait()
  175. for x,v in pairs(children) do
  176. if x/2 == math.ceil(x/2) then
  177. v.Transparency = i
  178. end
  179. end
  180. end
  181. elseif key == Enum.KeyCode.L then
  182. for i = 1,0,-.1 do
  183. renderstepped:wait()
  184. for x,v in pairs(children) do
  185. if v.Transparency > .1 and v ~= circle then
  186. v.Transparency = i
  187. end
  188. end
  189. end
  190. elseif key == Enum.KeyCode.U then
  191. rad = rad + 2
  192. for x,v in pairs(children) do
  193. if x/2 == math.ceil(x/2) and v ~= circle then
  194. local function lol()
  195. move(v,2)
  196. end
  197. spawn(lol)
  198. end
  199. end
  200. elseif key == Enum.KeyCode.P then
  201. rad = rad + 2
  202. for x,v in pairs(children) do
  203. if x/2 ~= math.ceil(x/2) and v~=circle then
  204. local function lol()
  205. move(v,2)
  206. end
  207. spawn(lol)
  208. end
  209. end
  210. end
  211. end)
  212.  
  213. --while wait(1) do
  214. -- random = math.random(-2,2)
  215. ---- get_startpoints()
  216. ---- get_endpoints(random)
  217. -- wait()
  218. -- lerp(random)
  219. --end
Advertisement
Add Comment
Please, Sign In to add comment