Advertisement
KarmaRange

Untitled

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