SHARE
TWEET

de

vibrantsinger423 Oct 21st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function doomlaser()
  2. local tween = game:GetService("TweenService")
  3.  
  4. local spread=Vector3.new((math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7)*(prt.Position-mouse.Hit.p).magnitude/60
  5. local TheHit=mouse.Hit.p
  6. local MouseLook=CFrame.new((prt.Position+TheHit)/2,TheHit+spread/16)
  7. local hit,pos = rayCast(prt.Position,MouseLook.lookVector,1000,laser)
  8.  
  9.  
  10. local list = {}
  11. table.insert(list,prt)
  12. local laser = Instance.new("Part",fold)
  13.  
  14. local mag=(prt.Position - pos).magnitude
  15. local Halfway = ((pos)/2)
  16.  
  17. val = val + 1
  18. val = val%9
  19. if val==1 then
  20. sond1.Pitch = (math.random(40,60)/100)
  21. sond1:Play()
  22. end
  23. if val==2 then
  24. sond2.Pitch = (math.random(40,60)/100)
  25. sond2:Play()
  26. end
  27. if val==3 then
  28. sond3.Pitch = (math.random(40,60)/100)
  29. sond3:Play()
  30. end
  31. if val==4 then
  32. sond4.Pitch = (math.random(40,60)/100)
  33. sond4:Play()
  34. end
  35. if val==5 then
  36. sond5.Pitch = (math.random(40,60)/100)
  37. sond5:Play()
  38. end
  39. if val==6 then
  40. sond6.Pitch = (math.random(40,60)/100)
  41. sond6:Play()
  42. end
  43. if val==7 then
  44. sond7.Pitch = (math.random(40,60)/100)
  45. sond7:Play()
  46. end
  47. if val==8 then
  48. sond8.Pitch = (math.random(40,60)/100)
  49. sond8:Play()
  50. end
  51.  
  52. laser.Anchored = true
  53. laser.Material = "Neon"
  54. laser.CanCollide = false
  55. laser.Size = Vector3.new(0.1,0.1,mag)
  56. laser.BrickColor = BrickColor.new("Really red")
  57.  
  58. laser.CFrame = CFrame.new((prt.Position+pos)/2,pos)
  59. game:GetService("Debris"):AddItem(laser,1.05)
  60. --print(mag)
  61. twen:Create(laser, TweenInfo.new(1,Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),
  62.     {Size = Vector3.new(laser.Size.X+6,laser.Size.Y+6,laser.Size.Z), Transparency = 1, Orientation = Vector3.new(laser.Orientation.X,laser.Orientation.Y,laser.Orientation.Z+math.random(-90,90))}-- ? left,right,
  63. ):Play()
  64.  
  65.     for _,i in pairs(hit.Parent:GetDescendants()) do
  66.       if i:IsA("Part") or i:IsA("WedgePart") or i:IsA("TrussPart") or i:IsA("CornerWedgePart") or i:IsA("BasePart") or i:IsA("MeshPart") then
  67.      if i.Parent~= workspace then
  68.         local bv = Instance.new("BodyVelocity",i)
  69.         --bv:Destroy()
  70.         bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  71.         bv.Velocity = MouseLook.lookVector*2000
  72.      
  73.         i.Anchored = false
  74.         spawn(function()
  75.         wait(0.1)
  76.         bv:Destroy()
  77.         end)
  78.       end
  79.      end
  80.     end
  81.    
  82. if(hit.Parent:FindFirstChildWhichIsA("Humanoid")== nil and hit.Parent:IsA("Accessory"))then
  83. if hit.Parent:FindFirstChildWhichIsA("Humanoid") == nil and hit.Parent:IsA("Accessory")  and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  84.     for _,i in pairs(hit.Parent:GetChildren()) do
  85.         --i:BreakJoints()
  86.         local bv = Instance.new("BodyVelocity",i)
  87.         bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  88.         bv.Velocity = MouseLook.lookVector*2000
  89.         spawn(function()
  90.         wait(0.1)
  91.         bv:Destroy()
  92.         --i:BreakJoints()
  93.         end)
  94.         spawn(function()
  95.         wait(0.1)
  96.         --i:Destroy()
  97.         end)
  98.     end
  99.  
  100. end
  101. end
  102.  
  103. if(hit.Parent:FindFirstChildWhichIsA("Humanoid")~= nil)then
  104. if hit.Parent:FindFirstChildWhichIsA("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  105.     for _,i in pairs(hit.Parent:GetChildren()) do
  106.         --i:BreakJoints()
  107.         local bv = Instance.new("BodyVelocity",i)
  108.         bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  109.         bv.Velocity = MouseLook.lookVector*2000
  110.         spawn(function()
  111.         wait(0.1)
  112.         bv:Destroy()
  113.         --i:BreakJoints()
  114.         end)
  115.         spawn(function()
  116.         wait(0.1)
  117.         --i:Destroy()
  118.         end)
  119.     end
  120.  
  121. end
  122. end
  123. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top