idkllal

Untitled

Mar 6th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1.  
  2. Player = game.Players.LocalPlayer
  3. if script.Parent.className~="HopperBin" then
  4. ma=Instance.new("HopperBin")
  5. ma.Name="[Laser Arm]"
  6. ma.Parent=Player.Backpack
  7. script.Parent=ma
  8. end
  9.  
  10. local Selected = false
  11. local Shoot = true
  12. function Click(Target)
  13. if(Target.Target.Parent:findFirstChild("Humanoid")~=nil)then
  14. Target.Target.Parent:BreakJoints()
  15. end
  16. local P = Instance.new("Part")
  17. P.Name = "Laser"
  18. local Place0 = Player.Character["Right Arm"].CFrame
  19. P.formFactor = 0
  20. P.Size = Vector3.new(1,1,(Place0.p - Target.Hit.p).magnitude)
  21. P.CFrame = CFrame.new((Place0.p + Target.Hit.p)/2,Place0.p)
  22. P.Parent = game.Workspace
  23. P.Color = Color3.new(0,0,1)
  24. P.Transparency = 0.5
  25. P.Reflectance = 0.5
  26. P.Anchored = true
  27. P.CanCollide = false
  28. local E = Instance.new("Explosion")
  29. E.Position = Target.Hit.p
  30. E.Parent = game.Workspace
  31. for i = 1,10 do
  32. P.Transparency = 0.5+(i*0.05)
  33. P.Reflectance = i*0.05
  34. wait(0.1)
  35. end
  36. P:Rremove()
  37. end
  38. function Select(Mouse)
  39. local Arm = Player.Character:findFirstChild("Right Arm")
  40. if(Arm==nil)then
  41. script.Parent:Remove()
  42. script:Remove()
  43. end
  44. Selected = true
  45. local Torso = Player.Character:findFirstChild("Torso")
  46. if(Torso==nil)then
  47. script.Parent:Remove()
  48. script:Remove()
  49. end
  50. local ArmWeld = Torso:findFirstChild("Right Shoulder")
  51. if(ArmWeld~=nil)then
  52. ArmWeld.Parent = nil
  53. end
  54. Mouse.Button1Down:connect(function()Click(Mouse)end)
  55. Arm.Anchored = true
  56. while Selected do
  57. local Place0 = Player.Character.Torso.CFrame
  58. Place0 = Place0 + ((Place0 * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)).lookVector * 0.5) + (Place0 * CFrame.fromEulerAnglesXYZ(0,-math.pi/2,0)).lookVector
  59. local Place1 = Place0 + ((Place0.p-Mouse.Hit.p).unit * -2)
  60. Arm.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0)
  61. wait()
  62. end
  63. Arm.Anchored = false
  64. if(ArmWeld~=nil)then
  65. ArmWeld.Parent = Torso
  66. end
  67. end
  68. function Deselect()
  69. Selected = false
  70. end
  71. ma.Selected:connect(Select)
  72. ma.Deselected:connect(Deselect)
Add Comment
Please, Sign In to add comment