astronaut32

cubix

Oct 15th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.66 KB | None | 0 0
  1. wait()
  2. local plr = game.Players.LocalPlayer
  3. local char = plr.Character
  4. local mouse = plr:GetMouse()
  5. ---
  6. local coolDown = false
  7. local box = Instance.new("Part",workspace)
  8. local fire = Instance.new("Fire",box)
  9. local slc = Instance.new("SelectionBox",box)
  10. local gui = Instance.new("BillboardGui",box)
  11. local txt = Instance.new("TextLabel",gui)
  12. local light = Instance.new("PointLight",box)
  13. local pew = Instance.new("Sound",box)
  14. local hit = false
  15. local isHitting = false
  16. pew.SoundId = "http://www.roblox.com/asset/?id=11944350"
  17. light.Range = 12
  18. light.Brightness = 5
  19. gui.StudsOffset = Vector3.new(0,3,0)
  20. txt.BackgroundTransparency = 1
  21. txt.FontSize = "Size24"
  22. gui.AlwaysOnTop = true
  23. gui.Size = UDim2.new(0,200,0,50)
  24. txt.Size = UDim2.new(0,200,0,50)
  25. txt.Text = (plr.Name.."'s Cubix")
  26. txt.Font = "SourceSansBold"
  27. txt.TextStrokeTransparency = 0.5
  28. slc.Adornee = box
  29. slc.Color3 = Color3.fromRGB(0,0,0)
  30. slc.LineThickness = 0.02
  31. slc.Transparency = .5
  32. slc.SurfaceTransparency = 0
  33. local txt2 = txt:Clone()
  34. txt2.Parent = gui
  35. txt2.Position = UDim2.new(0,0,0,18)
  36. txt2.Text = "- Created by KnightOfChess -"
  37. txt2.FontSize = "Size14"
  38. txt2.TextStrokeTransparency = .5
  39. txt2.TextColor3 = Color3.fromRGB(255,255,255)
  40. local pos = Instance.new("BodyPosition",box)
  41. local apos = Instance.new("BodyAngularVelocity",box)
  42. apos.AngularVelocity = Vector3.new(0,0,0)
  43. pos.P = 30000
  44. box.Size = Vector3.new(2.25,2.25,2.25)
  45. box.Transparency = .99
  46. fire.Heat = -7
  47. fire.Size = 8
  48. local box2 = box:Clone()
  49. box2.Parent = workspace
  50. box2.Fire:Destroy()
  51. box2.BillboardGui:Destroy()
  52. box2.BodyPosition:Destroy()
  53. box2.PointLight:Destroy()
  54. box2.BodyAngularVelocity:Destroy()
  55. box2.CanCollide = false
  56. box2.SelectionBox.SurfaceTransparency = 0.6
  57. box2.CustomPhysicalProperties = PhysicalProperties.new(.01)
  58. box2.CFrame = box.CFrame
  59. box2.Size = Vector3.new(2.6,2.6,2.6)
  60. box2.SelectionBox.Transparency = 1
  61. local weld = Instance.new("ManualWeld",box)
  62. weld.Part0 = box
  63. weld.Part1 = box2
  64. weld.C0 = box.CFrame:inverse() * box2.CFrame
  65.  
  66. mouse.Button1Down:connect(function()
  67. pew:Play()
  68. isHitting = true
  69. local ray = Ray.new(box.CFrame.p, (mouse.Hit.p - box.CFrame.p).unit * 300)
  70. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  71. local beam = box:Clone()
  72. local ring = Instance.new("Part", workspace)
  73. local msh = Instance.new("SpecialMesh",ring)
  74. msh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  75. ring.Size = Vector3.new(1,1,1)
  76. ring.Anchored = true
  77. ring.CanCollide = false
  78. ring.BrickColor = BrickColor.new("Mid gray")
  79. beam.Parent = workspace
  80. beam.Fire:Destroy()
  81. beam.BillboardGui:Destroy()
  82. beam.BodyPosition:Destroy()
  83. beam.PointLight:Destroy()
  84. beam.BodyAngularVelocity:Destroy()
  85. beam.CanCollide = false
  86. beam.Anchored = true
  87. beam.SelectionBox.Transparency = .5
  88. beam.SelectionBox.SurfaceTransparency = 1
  89. local distance = (box.CFrame.p - position).magnitude
  90. beam.Size = Vector3.new(.4, .4, distance)
  91. beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  92. ring.CFrame = beam.CFrame:toWorldSpace(CFrame.new(0,0,distance/2-2))
  93. coroutine.resume(coroutine.create(function()
  94. local Effect = box:Clone()
  95. Effect.Parent = workspace
  96. Effect:ClearAllChildren()
  97. Effect.CFrame = box.CFrame
  98. Effect.Anchored = true
  99. Effect.CanCollide = false
  100. local ESlc = slc:Clone()
  101. ESlc.Parent = Effect
  102. coroutine.resume(coroutine.create(function()
  103. for i = 2.5,3.5,.08 do
  104. ESlc.Adornee = Effect
  105. Effect.Size = Vector3.new(i,i,i)
  106. ESlc.SurfaceTransparency = ESlc.SurfaceTransparency + 0.075
  107. ESlc.Transparency = 1
  108. wait()
  109. end
  110. Effect:Destroy()
  111. isHitting = false
  112. end))
  113. coroutine.resume(coroutine.create(function()
  114. for i = .4,2.5,.17 do
  115. local a = Instance.new("Part", workspace)
  116. a.Anchored = true
  117. a.Transparency = 1
  118. a.CFrame = ring.CFrame:toWorldSpace(CFrame.new(0,0,5))
  119. pos.Position = a.Position
  120. a:Destroy()
  121. ring.Transparency = ring.Transparency + .08
  122. msh.Scale = msh.Scale + Vector3.new(.4,.4,0)
  123. box2.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
  124. beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  125. Effect.CFrame = box.CFrame
  126. beam.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
  127. beam.SelectionBox.LineThickness = beam.SelectionBox.LineThickness + .05
  128. beam.SelectionBox.Transparency = beam.SelectionBox.Transparency + .05
  129. wait()
  130. end
  131. ring:Destroy()
  132. beam:Destroy()
  133. end))
  134. end))
  135. beam.Touched:connect(function(p)
  136. local h = p.Parent:findFirstChild("Humanoid")
  137. if hit == false and h ~= nil and p.Parent~=char then
  138. h:TakeDamage(10)
  139. end
  140. end)
  141. end)
  142.  
  143. plr.Chatted:connect(function(msg)
  144. coroutine.resume(coroutine.create(function()
  145. local Effect = box:Clone()
  146. Effect.Parent = workspace
  147. Effect:ClearAllChildren()
  148. Effect.CFrame = box.CFrame
  149. Effect.Anchored = true
  150. Effect.CanCollide = false
  151. local ESlc = slc:Clone()
  152. ESlc.Parent = Effect
  153. for i = 2.5,3.5,.08 do
  154. ESlc.Adornee = Effect
  155. Effect.Size = Vector3.new(i,i,i)
  156. ESlc.SurfaceTransparency = ESlc.SurfaceTransparency + 0.075
  157. ESlc.Transparency = 1
  158. wait()
  159. end
  160. Effect:Destroy()
  161. end))
  162. for i = 0,#msg do
  163. txt.Text = ("- "..msg:sub(0,i).." -")
  164. wait(.055)
  165. end
  166. wait(2)
  167. txt.Text = (plr.Name.."'s Cubix")
  168. end)
  169.  
  170. coroutine.resume(coroutine.create(function()
  171. repeat
  172. r = 255
  173. g = 0
  174. b = 0
  175. for i = 0,255,5 do
  176. r = r - 5
  177. b = b + 5
  178. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  179. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  180. fire.Color = Color3.fromRGB(r,g,b)
  181. fire.SecondaryColor = fire.Color
  182. txt.TextColor3 = Color3.fromRGB(r,g,b)
  183. light.Color = Color3.fromRGB(r,g,b)
  184. wait()
  185. end
  186. for i = 0,255,5 do
  187. g = g + 5
  188. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  189. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  190. fire.Color = Color3.fromRGB(r,g,b)
  191. fire.SecondaryColor = fire.Color
  192. txt.TextColor3 = Color3.fromRGB(r,g,b)
  193. light.Color = Color3.fromRGB(r,g,b)
  194. wait()
  195. end
  196. for i = 0,255,5 do
  197. b = b - 5
  198. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  199. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  200. fire.Color = Color3.fromRGB(r,g,b)
  201. fire.SecondaryColor = fire.Color
  202. txt.TextColor3 = Color3.fromRGB(r,g,b)
  203. light.Color = Color3.fromRGB(r,g,b)
  204. wait()
  205. end
  206. for i = 0,255,5 do
  207. r = r + 5
  208. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  209. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  210. fire.Color = Color3.fromRGB(r,g,b)
  211. fire.SecondaryColor = fire.Color
  212. txt.TextColor3 = Color3.fromRGB(r,g,b)
  213. light.Color = Color3.fromRGB(r,g,b)
  214. wait()
  215. end
  216. for i = 0,255,5 do
  217. g = g - 5
  218. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  219. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  220. fire.Color = Color3.fromRGB(r,g,b)
  221. fire.SecondaryColor = fire.Color
  222. txt.TextColor3 = Color3.fromRGB(r,g,b)
  223. light.Color = Color3.fromRGB(r,g,b)
  224. wait()
  225. end
  226. until false
  227. end))
  228.  
  229. coroutine.resume(coroutine.create(function()
  230. repeat
  231. if isHitting == false then
  232. for i = 5,6,.01 do
  233. pos.Position = char.Torso.Position + Vector3.new(0,i,0)
  234. wait()
  235. end
  236. for i = 6,5,-.01 do
  237. pos.Position = char.Torso.Position + Vector3.new(0,i,0)
  238. wait()
  239. end
  240. end
  241. wait()
  242. until false
  243. end))
  244.  
  245. coroutine.resume(coroutine.create(function()
  246. repeat wait(2)
  247. local num = math.random(-3,3)
  248. apos.AngularVelocity = Vector3.new(num,num,num)
  249. until false
  250. end))
  251.  
  252. coroutine.resume(coroutine.create(function()
  253. repeat wait()
  254. slc.Adornee = box
  255. until false
  256. end))
  257.  
  258. coroutine.resume(coroutine.create(function()
  259. repeat wait() until char.Humanoid.Health <= 0
  260. for i = 2.5,3.2,.05 do
  261. txt.TextTransparency = txt.Transparency + 0.075
  262. slc.SurfaceTransparency = slc.SurfaceTransparency + 0.075
  263. slc.Transparency = slc.Transparency + 0.075
  264. wait()
  265. end
  266. box:Destroy()
  267. end))
Add Comment
Please, Sign In to add comment