Advertisement
Guest User

Untitled

a guest
May 20th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. local Selected = true
  2. local Shoot = true
  3. function Clean(Mod)
  4. local i = Mod:GetChildren()
  5. for P = 1,#i do
  6. if(string.sub(i[P].className,1,4) == "Body")then
  7. i[P]:Remove()
  8. else
  9. Clean(i[P])
  10. end
  11. end
  12. end
  13. function FindHum(Targ)
  14. local S = Targ
  15. while true do
  16. if(S==game)then return end
  17. S = S.Parent
  18. if(S:findFirstChild("Humanoid")~=nil)then return S.Humanoid end
  19. end
  20. return nil
  21. end
  22. function Click(Target)
  23. if(Target.Target == nil)then return end
  24. local A = FindHum(Target.Target)
  25. if(A~=nil)then
  26. A.Sit = true
  27. Clean(A.Parent)
  28. end
  29. local P = Instance.new("Part")
  30. P.Name = "Andy1515" --- Change This To Your Player
  31. local Place0 = script.Parent.Parent.Parent.Character["Left Arm"].CFrame
  32. P.formFactor = 0
  33. P.Size = Vector3.new(1,1,(Place0.p - Target.Hit.p).magnitude)
  34. P.CFrame = CFrame.new((Place0.p + Target.Hit.p)/2,Place0.p)
  35. P.Parent = game.Workspace
  36. P.Color = Color3.new(1,0.5,0)
  37. P.Transparency = 1
  38. P.Reflectance = 0
  39. P.Anchored = true
  40. P.CanCollide = false
  41. if(A~=nil)then
  42. if(A.Parent:findFirstChild("Torso")~=nil)then
  43. A.Parent.Torso.Velocity = P.CFrame.lookVector * -200
  44. end
  45. end
  46. for i = 1,10 do
  47. P.Transparency = 1+(i*0.05)
  48. wait(0.1)
  49. end
  50. P:Remove()
  51. end
  52. function Select(Mouse)
  53. local Arm = script.Parent.Parent.Parent.Character:findFirstChild("Left Arm")
  54. if(Arm==nil)then
  55. script.Parent:Remove()
  56. script:Remove()
  57. end
  58. Selected = true
  59. local Torso = script.Parent.Parent.Parent.Character:findFirstChild("Torso")
  60. if(Torso==nil)then
  61. script.Parent:Remove()
  62. script:Remove()
  63. end
  64. local ArmWeld = Torso:findFirstChild("Left Shoulder")
  65. if(ArmWeld~=nil)then
  66. ArmWeld.Parent = nil
  67. end
  68. Mouse.Button1Down:connect(function()Click(Mouse)end)
  69. Arm.Anchored = true
  70. while Selected do
  71. local Place0 = script.Parent.Parent.Parent.Character.Torso.CFrame
  72. Place0 = Place0 + ((Place0 * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)).lookVector * 0.5) + (Place0 * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)).lookVector
  73. local Place1 = Place0 + ((Place0.p-Mouse.Hit.p).unit * -2)
  74. Arm.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0)
  75. wait()
  76. end
  77. Arm.Anchored = false
  78. if(ArmWeld~=nil)then
  79. ArmWeld.Parent = Torso
  80. end
  81. end
  82. function Deselect()
  83. Selected = false
  84. end
  85. script.Parent.Selected:connect(Select)
  86. script.Parent.Deselected:connect(Deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement