Advertisement
ajcooper2003

Untitled

Oct 3rd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ----------------------------------------
  2.  -- Originally made by Alfederate :D --
  3. ----------------------------------------
  4.  
  5.  -- there's no time to explain! --
  6.  
  7. local new=Instance.new
  8. local rad=math.rad
  9. local cf=CFrame.new
  10. local v3=Vector3.new
  11. local ang=function(x,y,z)
  12. return CFrame.Angles(rad(x),rad(y),rad(z))
  13. end
  14. local player=game:service'Players'.LocalPlayer
  15. local char=player.Character
  16. local cam=workspace.Camera
  17. local mouse=player:GetMouse()
  18. local weld=function(a,b,c0,c1)
  19. m=Instance.new('Motor',a)
  20. m.Part0=a
  21. m.Part1=b
  22. m.C0=c0
  23. m.C1=c1
  24. return m
  25. end
  26.  
  27. snd='rbxassetid://229425359'
  28. beamm=Instance.new('Model',workspace)
  29. beamm.Name='beam'
  30.  
  31. laser=false
  32.  
  33. rs=Instance.new('Part',char)
  34. rs.Transparency=1
  35. rs.CanCollide=false
  36. rs.TopSurface,rs.BottomSurface=0,0
  37. rs.FormFactor=3
  38. rs.Size=Vector3.new(.5,.5,.5)
  39.  
  40. ls=rs:Clone()
  41. ls.Parent=char
  42.  
  43. rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
  44. lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
  45. raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
  46. law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
  47.  
  48. s1=Instance.new('Sound',char)
  49. s1.Volume=1
  50. s1.Pitch=1.2
  51. s1.Looped=true
  52. s1.SoundId=snd
  53.  
  54. particles={}
  55.  
  56. local wep=new('Part',char)
  57. wep.FormFactor=3
  58. wep.CanCollide=false
  59. wep.Size=v3(1,3,1)
  60. wep.TopSurface,wep.BottomSurface=0,0
  61. local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
  62.  
  63. local beam=wep:Clone()
  64. beam:ClearAllChildren()
  65. beam.Material='Neon'
  66. beam.BrickColor=BrickColor.new('White')
  67. beam.Size=Vector3.new(3,3,1)
  68. beam.Transparency=.5
  69. beam.Anchored=true
  70. local ms=Instance.new('BlockMesh',beam)
  71. local inner=beam:Clone()
  72. inner.Transparency=0
  73. inner.Material='SmoothPlastic'
  74. inner.BrickColor=BrickColor.new('Black')
  75. local ms2=inner.Mesh
  76.  
  77. local expl=inner:Clone()
  78. expl.Mesh:Destroy()
  79. expl.Material='Neon'
  80. expl.BrickColor=BrickColor.new('White')
  81. expl.Size=Vector3.new(11,11,11)
  82. expl.Transparency=.55
  83. pl=Instance.new('PointLight',expl)
  84. pl.Color=expl.BrickColor.Color
  85. pl.Range=pl.Range*2
  86. pl.Name='light'
  87. local br=pl.Range
  88.  
  89. local exa=expl:Clone()
  90. exa.Size=Vector3.new(4,4,4)
  91. pl2=exa.light
  92.  
  93. local part=exa:Clone()
  94. part.Size=Vector3.new(1.5,1.5,1.5)
  95. pl3=part.light
  96. pms=Instance.new('BlockMesh',part)
  97.  
  98. char.Humanoid.Died:connect(function()
  99. laser=false
  100. beam.Parent=nil
  101. inner.Parent=nil
  102. s1:stop()
  103. end)
  104.  
  105. mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
  106. laser=true
  107. s1.Volume=1
  108. s1:play()
  109. end end)
  110. mouse.Button1Up:connect(function()
  111. laser=false
  112. beam.Parent=nil
  113. inner.Parent=nil
  114. s1:stop()
  115. end)
  116.  
  117. parti=0
  118. game:service'RunService'.Stepped:connect(function()
  119. parti=parti+1
  120. for i,v in pairs(particles) do
  121. v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
  122. v.Transparency=v.Transparency+.08
  123. if v.Transparency >= 1 then
  124. v:Destroy()
  125. table.remove(particles,i)
  126. else
  127. v.Parent=beamm
  128. end
  129. end
  130. a=cam.CoordinateFrame.p
  131. b=mouse.Hit.p
  132. mhitr=Ray.new(a,(b-a).unit*999)
  133. mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
  134. raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
  135. law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
  136. if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
  137. char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
  138. end
  139. if laser then
  140. beamm.Parent=workspace
  141. beam.Parent=beamm
  142. inner.Parent=beamm
  143. s1.Volume=s1.Volume-.002
  144.  
  145. ray=Ray.new((wep.CFrame*cf(0,-1.5,0)).p,((wep.CFrame*cf(0,-10,0)).p-(wep.CFrame*cf(0,-1.5,0)).p).unit*999)
  146. hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
  147.  
  148. if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
  149. Instance.new('Explosion',workspace).Position=pos
  150. end
  151. if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
  152. game.Workspace:BreakJoints()
  153. end
  154. if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
  155. hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
  156. end
  157.  
  158. if parti==math.floor(parti) then
  159. par=part:Clone()
  160. table.insert(particles,par)
  161. par.Parent=beamm
  162. par.Transparency=1-s1.Volume
  163. par.light.Range=br*s1.Volume
  164. par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
  165. end
  166.  
  167. mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
  168. ms.Scale=v3(s1.Volume,s1.Volume,mag)
  169. ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
  170. beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
  171. inner.CFrame=beam.CFrame
  172. pl.Range=br*s1.Volume
  173. pl2.Range=br*s1.Volume
  174. char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
  175. end
  176. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement