Advertisement
nealpogi213

cam laser

Apr 20th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. end
  2. bin = script.Parent
  3.  
  4. cam = workspace.CurrentCamera
  5. function sel(mouse)
  6. sel = true
  7. mouse.Button1Down:connect(function()
  8. mousehold = true
  9. if mode == 1 then
  10. me.Character = nil
  11. cam.CameraSubject = nil
  12. cam.CameraType = "Fixed"
  13. mode = 0
  14. else
  15. while sel and mousehold do
  16. local dis = (cam.CoordinateFrame.p - mouse.Hit.p).magnitude
  17. local pew = Instance.new("Part")
  18. prop(pew,workspace,false,0.1,0,0.1,1,0.1,"Bright yellow",true,"Custom")
  19. pew.CFrame = CFrame.new(cam.CoordinateFrame * CFrame.new(math.random(-100,100)/10,math.random(-100,100)/10,math.random(0,100)/10).p,mouse.Hit.p) * CFrame.Angles(math.pi/2,0,0) * CFrame.new(0,-dis/2,0)
  20. local mes = Instance.new("CylinderMesh",pew)
  21. mes.Scale = Vector3.new(15,dis,15)
  22. local ex = Instance.new("Explosion",workspace)
  23. ex.BlastRadius = 6
  24. ex.BlastPressure = 450000
  25. ex.Position = pew.CFrame * CFrame.new(0,-dis/2,0).p
  26. ex.Hit:connect(function(p)
  27. if p:GetMass() < 100 then
  28. p.BrickColor = BrickColor.new("Black")
  29. p.Transparency = 0.3
  30. p.Anchored = false
  31. p:BreakJoints()
  32. end
  33. end)
  34. coroutine.resume(coroutine.create(function()
  35. for i=0.1,1,0.2 do
  36. wait()
  37. pew.Transparency = i
  38. end
  39. pew:remove()
  40. end))
  41. wait()
  42. end
  43. end
  44. end)
  45. mouse.Button1Up:connect(function()
  46. mousehold = false
  47. end)
  48. end
  49.  
  50. function desel()
  51. mousehold = false
  52. sel = false
  53. end
  54.  
  55. bin.Deselected:connect(desel)
  56. bin.Selected:connect(sel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement