Advertisement
FloweyTheFlower

Roblox Scripts #25 dun dun dun Gun

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