Advertisement
Gotmilk0086

Untitled

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