Verhed

as

Jul 6th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.96 KB | None | 0 0
  1. ---< Cubix Beta >---
  2. -- By KnightOfChess --
  3. local plr = game.Players.LocalPlayer
  4. local char = plr.Character
  5. local mouse = plr:GetMouse()
  6. local render = game:GetService("RunService").RenderStepped
  7. local version = 1.3
  8. ---
  9. defaultText = (char.Name.."'s Cubix")
  10. local coolDown = false
  11. local box = Instance.new("Part",workspace)
  12. local fire = Instance.new("Fire",box)
  13. local slc = Instance.new("SelectionBox",box)
  14. local gui = Instance.new("BillboardGui",box)
  15. local txt = Instance.new("TextLabel",gui)
  16. local light = Instance.new("PointLight",box)
  17. local pew = Instance.new("Sound",box)
  18. local hitmarker = Instance.new("Part",workspace)
  19. local hitmsh = Instance.new("SpecialMesh",hitmarker)
  20. hitmsh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  21. hitmarker.Anchored = true
  22. hitmarker.Transparency = .5
  23. hitmarker.CFrame = mouse.Hit
  24. box.Name = "Cubix"
  25. hitmsh.Scale = Vector3.new(4,4,.01)
  26. hitmarker.CanCollide = false
  27. local hit = false
  28. local isHitting = false
  29. local lastcmd = "kill"
  30. pew.SoundId = "http://www.roblox.com/asset/?id=11944350"
  31. light.Range = 12
  32. light.Brightness = 5
  33. gui.StudsOffset = Vector3.new(0,3,0)
  34. txt.Name = "Cubix"
  35. txt.BackgroundTransparency = 1
  36. txt.FontSize = "Size24"
  37. gui.AlwaysOnTop = true
  38. gui.Size = UDim2.new(0,200,0,50)
  39. txt.Size = UDim2.new(0,200,0,50)
  40. txt.Text = defaultText
  41. txt.Font = "SourceSansBold"
  42. txt.TextStrokeTransparency = 0.5
  43. slc.Adornee = box
  44. slc.Color3 = Color3.fromRGB(0,0,0)
  45. slc.LineThickness = 0.02
  46. slc.Transparency = .5
  47. slc.SurfaceTransparency = 0
  48. local txt2 = txt:Clone()
  49. txt2.Parent = gui
  50. txt2.Position = UDim2.new(0,0,0,18)
  51. txt2.Text = "- Created by KnightOfChess and safiknaufal45 -"
  52. txt2.FontSize = "Size14"
  53. txt2.TextStrokeTransparency = .5
  54. txt2.TextColor3 = Color3.fromRGB(255,255,255)
  55. local pos = Instance.new("BodyPosition",box)
  56. local apos = Instance.new("BodyAngularVelocity",box)
  57. apos.AngularVelocity = Vector3.new(0,0,0)
  58. pos.P = 20000
  59. box.Size = Vector3.new(2.25,2.25,2.25)
  60. box.Transparency = .99
  61. fire.Heat = -7
  62. fire.Size = 8
  63. local box2 = box:Clone()
  64. box2.Parent = workspace
  65. box2.Fire:Destroy()
  66. box2.BillboardGui:Destroy()
  67. box2.BodyPosition:Destroy()
  68. box2.PointLight:Destroy()
  69. box2.BodyAngularVelocity:Destroy()
  70. box2.CanCollide = false
  71. box2.SelectionBox.SurfaceTransparency = 0.6
  72. local physicalProperties = PhysicalProperties.new(.01,.3,.5,1,1)
  73. box2.CustomPhysicalProperties = physicalProperties
  74. box.CustomPhysicalProperties = physicalProperties
  75. box2.CFrame = box.CFrame
  76. box2.Size = Vector3.new(2.6,2.6,2.6)
  77. box2.SelectionBox.Transparency = 1
  78. local weld = Instance.new("ManualWeld",box)
  79. weld.Part0 = box
  80. weld.Part1 = box2
  81. weld.C0 = box.CFrame:inverse() * box2.CFrame
  82.  
  83. mouse.Button1Down:connect(function()
  84. if box~=nil then
  85. pew:Play()
  86. isHitting = true
  87. local ray = Ray.new(box.CFrame.p, (mouse.Hit.p - box.CFrame.p).unit * 300)
  88. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  89. local beam = box:Clone()
  90. local ring = Instance.new("Part", workspace)
  91. local msh = Instance.new("SpecialMesh",ring)
  92. local explode = Instance.new("Part",workspace)
  93. local smesh = Instance.new("SpecialMesh",explode)
  94. smesh.MeshType = "Sphere"
  95. explode.Anchored = true
  96. explode.CanCollide = false
  97. explode.Size = Vector3.new(1,1,1)
  98. explode.TopSurface = "Smooth"
  99. explode.BottomSurface = "Smooth"
  100. msh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  101. ring.Size = Vector3.new(1,1,1)
  102. ring.Anchored = true
  103. ring.CanCollide = false
  104. ring.BrickColor = BrickColor.new("Mid gray")
  105. beam.Parent = workspace
  106. beam.Fire:Destroy()
  107. beam.BillboardGui:Destroy()
  108. beam.BodyPosition:Destroy()
  109. beam.PointLight:Destroy()
  110. beam.BodyAngularVelocity:Destroy()
  111. beam.CanCollide = false
  112. beam.Anchored = true
  113. beam.SelectionBox.Transparency = .5
  114. beam.SelectionBox.SurfaceTransparency = 1
  115. local distance = (box.CFrame.p - position).magnitude
  116. beam.Size = Vector3.new(.4, .4, distance)
  117. beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  118. ring.CFrame = beam.CFrame:toWorldSpace(CFrame.new(0,0,distance/2-2))
  119. explode.CFrame = hitmarker.CFrame
  120. local fakemarker = hitmarker:Clone()
  121. fakemarker.Parent = workspace
  122. fakemarker.CFrame = hitmarker.CFrame
  123. coroutine.resume(coroutine.create(function()
  124. isHitting = false
  125. end))
  126. coroutine.resume(coroutine.create(function()
  127. for i = .4,2.5,.09 do
  128. local a = Instance.new("Part", workspace)
  129. a.Anchored = true
  130. a.Transparency = 1
  131. explode.Mesh.Scale = explode.Mesh.Scale + Vector3.new(i/2.5,i/2.5,i/2.5)
  132. explode.Transparency = i/2
  133. fakemarker.Mesh.Scale = fakemarker.Mesh.Scale + Vector3.new(.3,.3,0)
  134. fakemarker.Transparency = i-.4
  135. a.CFrame = ring.CFrame:toWorldSpace(CFrame.new(0,0,5))
  136. pos.Position = a.Position
  137. a:Destroy()
  138. ring.Transparency = ring.Transparency + .06
  139. msh.Scale = msh.Scale + Vector3.new(.3,.3,0)
  140. box2.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
  141. beam.CFrame = CFrame.new(box.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  142. beam.SelectionBox.Color3 = Color3.fromRGB(r,g,b)
  143. beam.SelectionBox.LineThickness = beam.SelectionBox.LineThickness + .03
  144. beam.SelectionBox.Transparency = beam.SelectionBox.Transparency + .03
  145. render:wait()
  146. end
  147. ring:Destroy()
  148. beam:Destroy()
  149. fakemarker:Destroy()
  150. explode:Destroy()
  151. end))
  152. beam.Touched:connect(function(p)
  153. if lastcmd == "kill" then
  154. local h = p.Parent:findFirstChild("Humanoid")
  155. if hit == false and h ~= nil and p.Parent~=char then
  156. p.Parent:BreakJoints()
  157. end
  158. elseif lastcmd == "explode" then
  159. local p = Instance.new("Part",workspace)
  160. p.Transparency = 1
  161. p.CFrame = beam.CFrame:toWorldSpace(CFrame.new(0,0,-distance/2))
  162. local ex = Instance.new("Explosion",workspace)
  163. ex.Position = p.Position
  164. p:Destroy()
  165. elseif lastcmd == "kick" then
  166. local h = p.Parent:findFirstChild("Humanoid")
  167. if hit == false and h ~= nil and p.Parent ~= char then
  168. local playr = game.Players:findFirstChild(p.Parent.Name)
  169. if playr ~= nil then
  170. playr:Destroy()
  171. end
  172. end
  173. elseif lastcmd == "ff" then
  174. local h = p.Parent:findFirstChild("Humanoid")
  175. if h~=nil then
  176. local ff = Instance.new("ForceField")
  177. ff.Parent = p.Parent
  178. end
  179. elseif lastcmd == "destroy" then
  180. coroutine.resume(coroutine.create(function()
  181. if p.Parent~=char and p~=box and p~=box2 and p.Name~="Baseplate" then
  182. for i = p.Transparency,1,.025 do
  183. p.Transparency = i
  184. render:wait()
  185. end
  186. p:Destroy()
  187. end
  188. end))
  189. elseif lastcmd == "damage" then
  190. local h = p.Parent:findFirstChild("Humanoid")
  191. if h~=nil and dmg and hit == false then
  192. h:TakeDamage(dmg)
  193. end
  194. elseif lastcmd == "fire" then
  195. local h = p.Parent:findFirstChild("Humanoid")
  196. if h~=nil and p.Parent~=char then
  197. local burn = Instance.new("Fire",p.Parent.Torso)
  198. coroutine.resume(coroutine.create(function()
  199. repeat render:wait()
  200. if burn.Size < 10 then
  201. burn.Size = burn.Size + .05
  202. end
  203. burn.Color = Color3.fromRGB(r,g,b)
  204. burn.SecondaryColor = burn.Color
  205. h:TakeDamage(.2)
  206. until h.Health <= 0
  207. burn:Destroy()
  208. end))
  209. end
  210. end
  211. end)
  212. end
  213. end)
  214.  
  215. function TypeMsg(msg,obj)
  216. for i = 0,#msg do
  217. obj.Text = msg:sub(0,i)
  218. wait(.055)
  219. end
  220. end
  221.  
  222. plr.Chatted:connect(function(msg)
  223. local msg2 = msg
  224. if msg2 == "/setbeam kill" or msg2 == "/sb kill" then
  225. lastcmd = "kill"
  226. msg2 = 'Beam set to "Kill".'
  227. txt2.Text = "- Kill Beam activated. -"
  228. TypeMsg(msg2,txt)
  229. end
  230. if msg2 == "/setbeam explode" or msg2 == "/sb explode" then
  231. lastcmd = "explode"
  232. msg2 = 'Beam set to "Explode".'
  233. txt2.Text = "- Explosive Beam activated. -"
  234. TypeMsg(msg2,txt)
  235. end
  236. if msg2 == "/setbeam kick" or msg2 == "/sb kick" then
  237. lastcmd = "kick"
  238. msg2 = '- Beam set to "Kick". -'
  239. txt2.Text = "- Kick Beam activated. -"
  240. TypeMsg(msg2,txt)
  241. end
  242. if msg2 == "/setbeam ff" or msg2 == "/sb ff" then
  243. lastcmd = "ff"
  244. msg2 = '- Beam set to "Forcefield" -'
  245. txt2.Text = "- Forcefield Beam activated. -"
  246. TypeMsg(msg2,txt)
  247. end
  248. if msg2 == "/setbeam destroy" or msg2 == "/sb destroy" then
  249. lastcmd = "destroy"
  250. msg2 = '- Beam set to "Destroy" -'
  251. txt2.Text = "- Destroy Beam activated. -"
  252. TypeMsg(msg2,txt)
  253. end
  254. if msg2:sub(1,13) == "/setbeam dmg " or msg2:sub(1,8) == "/sb dmg " then
  255. lastcmd = "damage"
  256. if #msg2>13 then
  257. dmg = msg2:sub(13,#msg2)
  258. else dmg = msg2:sub(8,#msg2)
  259. end
  260. msg2 = ('- Beam set to "Damage" '.."("..dmg.." )".." -")
  261. txt2.Text = "- Damage Beam activated -"
  262. TypeMsg(msg2,txt)
  263. end
  264. if msg2 == "/setbeam fire" or msg2 == "/sb fire" then
  265. lastcmd = "fire"
  266. msg2 = '- Beam set to "Fire" -'
  267. txt2.Text = "- Fire Beam activated -"
  268. TypeMsg(msg2,txt)
  269. end
  270. coroutine.resume(coroutine.create(function()
  271. local Effect = box:Clone()
  272. Effect.Parent = workspace
  273. Effect:ClearAllChildren()
  274. Effect.CFrame = box.CFrame
  275. Effect.Anchored = true
  276. Effect.CanCollide = false
  277. local ESlc = slc:Clone()
  278. ESlc.Parent = Effect
  279. for i = 2.5,3.5,.05 do
  280. ESlc.Adornee = Effect
  281. Effect.Size = Vector3.new(i,i,i)
  282. ESlc.SurfaceTransparency = ESlc.SurfaceTransparency + 0.065
  283. ESlc.Transparency = 1
  284. render:wait()
  285. end
  286. Effect:Destroy()
  287. end))
  288. if msg:sub(0,1)~="/" then
  289. for i = 0,#msg do
  290. txt.Text = ("- "..msg:sub(0,i).." -")
  291. wait(.055)
  292. end
  293. end
  294. wait(2)
  295. txt.Text = defaultText
  296. end)
  297.  
  298. coroutine.resume(coroutine.create(function()
  299. repeat
  300. r = 255
  301. g = 0
  302. b = 0
  303. for i = 0,255,3 do
  304. r = r - 3
  305. b = b + 3
  306. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  307. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  308. fire.Color = Color3.fromRGB(r,g,b)
  309. fire.SecondaryColor = fire.Color
  310. txt.TextColor3 = Color3.fromRGB(r,g,b)
  311. light.Color = Color3.fromRGB(r,g,b)
  312. render:wait()
  313. end
  314. for i = 0,255,3 do
  315. g = g + 3
  316. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  317. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  318. fire.Color = Color3.fromRGB(r,g,b)
  319. fire.SecondaryColor = fire.Color
  320. txt.TextColor3 = Color3.fromRGB(r,g,b)
  321. light.Color = Color3.fromRGB(r,g,b)
  322. render:wait()
  323. end
  324. for i = 0,255,3 do
  325. b = b - 3
  326. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  327. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  328. fire.Color = Color3.fromRGB(r,g,b)
  329. fire.SecondaryColor = fire.Color
  330. txt.TextColor3 = Color3.fromRGB(r,g,b)
  331. light.Color = Color3.fromRGB(r,g,b)
  332. render:wait()
  333. end
  334. for i = 0,255,3 do
  335. r = r + 3
  336. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  337. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  338. fire.Color = Color3.fromRGB(r,g,b)
  339. fire.SecondaryColor = fire.Color
  340. txt.TextColor3 = Color3.fromRGB(r,g,b)
  341. light.Color = Color3.fromRGB(r,g,b)
  342. render:wait()
  343. end
  344. for i = 0,255,3 do
  345. g = g - 3
  346. slc.SurfaceColor3 = Color3.fromRGB(r,g,b)
  347. box2.SelectionBox.SurfaceColor3 = Color3.fromRGB(r,g,b)
  348. fire.Color = Color3.fromRGB(r,g,b)
  349. fire.SecondaryColor = fire.Color
  350. txt.TextColor3 = Color3.fromRGB(r,g,b)
  351. light.Color = Color3.fromRGB(r,g,b)
  352. render:wait()
  353. end
  354. until false
  355. end))
  356.  
  357. coroutine.resume(coroutine.create(function()
  358. repeat
  359. if isHitting == false then
  360. local x = Instance.new("Part",workspace)
  361. x.Transparency = 1
  362. x.CanCollide = false
  363. x.Anchored = true
  364. coroutine.resume(coroutine.create(function()
  365. repeat render:wait()
  366. x.CFrame = char.Torso.CFrame:toWorldSpace(CFrame.new(3,4,0))
  367. until false
  368. end))
  369. for i = 3,4,.005 do
  370. pos.Position = x.Position + Vector3.new(0,.01,0)
  371. render:wait()
  372. end
  373. for i = 4,3,-.005 do
  374. pos.Position = x.Position + Vector3.new(0,-.01,0)
  375. render:wait()
  376. end
  377. x:Destroy()
  378. end
  379. until false
  380. end))
  381.  
  382. coroutine.resume(coroutine.create(function()
  383. repeat wait(.75)
  384. local boom = Instance.new("Part",workspace)
  385. local bmsh = Instance.new("SpecialMesh",boom)
  386. bmsh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  387. boom.Size = Vector3.new(1,1,1)
  388. bmsh.Scale = Vector3.new(3,1,3)
  389. boom.Anchored = true
  390. boom.CanCollide = false
  391. boom.Position = Vector3.new(box.CFrame.x,0,box.CFrame.z)
  392. coroutine.resume(coroutine.create(function()
  393. for i = 1,2,.01 do
  394. boom.Position = Vector3.new(box.CFrame.x,.1,box.CFrame.z)
  395. boom.CFrame = boom.CFrame * CFrame.fromEulerAnglesXYZ(0,.15,0)
  396. boom.Transparency = i/1.8
  397. bmsh.Scale = bmsh.Scale + Vector3.new(i/25,-.01,i/25)
  398. render:wait()
  399. end
  400. boom:Destroy()
  401. end))
  402. until not char
  403. end))
  404.  
  405. coroutine.resume(coroutine.create(function()
  406. local spin = 4
  407. repeat
  408. local num = math.random(spin*-1000,spin*1000)/1000
  409. for i = 0,num,.01 do
  410. apos.AngularVelocity = Vector3.new(i,i,i)
  411. render:wait()
  412. end
  413. for i = num,0,-.01 do
  414. apos.AngularVelocity = Vector3.new(i,i,i)
  415. render:wait()
  416. end
  417. until not char
  418. end))
  419. coroutine.resume(coroutine.create(function()
  420. repeat render:wait()
  421. slc.Adornee = box
  422. hitmarker.CFrame = CFrame.new(mouse.Hit.X,0,mouse.Hit.Z) * CFrame.fromEulerAnglesXYZ(-1.5708,0,0)
  423. until false
  424. end))
  425.  
  426. coroutine.resume(coroutine.create(function()
  427. char.Humanoid.Died:connect(function()
  428. for i = 2.5,3.2,.025 do
  429. txt.TextTransparency = txt.Transparency + 0.075
  430. slc.SurfaceTransparency = slc.SurfaceTransparency + 0.075
  431. slc.Transparency = slc.Transparency + 0.075
  432. render:wait()
  433. end
  434. box:Destroy()
  435. box2:Destroy()
  436. end)
  437. end))
Add Comment
Please, Sign In to add comment