okban

fefe

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