Hebablazin

Laser Arm

May 30th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.22 KB | None | 0 0
  1. -- This is local
  2.  
  3.  
  4. local player = game.Players.LocalPlayer
  5.  
  6. local mouse = player:GetMouse()
  7.  
  8. local bin = Instance.new("HopperBin", player.Backpack) -- just to keep the friend request thing off
  9.  
  10. bin.Name = "laza!!"
  11.  
  12.  
  13. local cannon = false
  14.  
  15. local char = player.Character
  16.  
  17. local T = char:findFirstChild("Torso")
  18.  
  19. local RA = char:findFirstChild("Right Arm")
  20.  
  21. local LA = char:findFirstChild("Left Arm")
  22.  
  23. local RS = T:findFirstChild("Right Shoulder")
  24.  
  25. local LS = T:findFirstChild("Left Shoulder")
  26.  
  27. local new = player.Character.Head:clone()
  28.  
  29. new.Name = "Fakehead"
  30.  
  31. new.Anchored = true
  32.  
  33. new.CanCollide = false
  34.  
  35.  
  36. Delay(0, function()
  37.  
  38. local hats = {}
  39.  
  40. local CFs = {}
  41.  
  42. local Ds = {}
  43.  
  44. for _, v in ipairs(player.Character:GetChildren()) do
  45.  
  46. if v:IsA("Accoutrement") then
  47.  
  48. local h = v:findFirstChild("Handle")
  49.  
  50. if h then
  51.  
  52. if h:GetMass() < 20 then
  53.  
  54. h.Transparency = 1
  55.  
  56. h = h:clone()
  57.  
  58. h.Transparency = 0
  59.  
  60. h.Anchored = true
  61.  
  62. h.Parent = player.Character
  63.  
  64. pcall(function()
  65.  
  66. table.insert(hats, h)
  67.  
  68. local look = CFrame.new(player.Character.Head.Position, h.Position)
  69.  
  70. local X,Y,Z = look:toEulerAnglesXYZ()
  71.  
  72. table.insert(CFs, CFrame.Angles(X,Y,Z))
  73.  
  74. table.insert(Ds, (player.Character.Head.Position - h.Position).magnitude)
  75.  
  76. end)
  77.  
  78. end
  79.  
  80. end
  81.  
  82. end
  83.  
  84. end
  85.  
  86. Delay(0, function()
  87.  
  88. repeat wait(.5) until cannon
  89.  
  90. if cannon then
  91.  
  92. RS.Parent = nil
  93.  
  94. LS.Parent = nil
  95.  
  96. RA.Anchored = true
  97.  
  98. LA.Anchored = true
  99.  
  100. end
  101.  
  102. end)
  103.  
  104. player.Character.Head.Transparency = .9
  105.  
  106. local face = player.Character.Head.face
  107.  
  108. face.Parent = nil
  109.  
  110. function Move()
  111.  
  112. new.Parent = player.Character
  113.  
  114. new.Anchored = false
  115.  
  116. local W = new:findFirstChild("Weld") or Instance.new("Weld", new)
  117.  
  118. W.Part0 = new
  119.  
  120. W.Part1 = player.Character.Head
  121.  
  122. local cf = CFrame.new(player.Character.Head.Position, mouse.Hit.p)
  123.  
  124. W.C0 = cf:inverse()
  125.  
  126. W.C1 = player.Character.Head.CFrame:inverse()
  127.  
  128. for _, v in ipairs(hats) do
  129.  
  130. local w = v:findFirstChild("Weld") or Instance.new("Weld", v)
  131.  
  132. w.Part0 = v
  133.  
  134. w.Part1 = new
  135.  
  136. local cf = new.CFrame + (new.CFrame*CFs[_]).lookVector*Ds[_]
  137.  
  138. w.C0 = cf:inverse()
  139.  
  140. w.C1 = new.CFrame:inverse()
  141.  
  142. v.Anchored = false
  143.  
  144. end
  145.  
  146. end
  147.  
  148. Move()
  149.  
  150. player.Character.Torso.Changed:connect(function() Move() end)
  151.  
  152. Delay(0, function()
  153.  
  154. while true do
  155.  
  156. local TP1 = player.Character.Torso.Position + player.Character.Torso.CFrame.lookVector*100
  157.  
  158. local TP2 = player.Character.Torso.Position + CFrame.new(player.Character.Torso.Position, mouse.Hit.p).lookVector*100
  159.  
  160. TP2 = TP2*Vector3.new(1,0,1) + TP1*Vector3.new(0,1,0)
  161.  
  162. if cannon then
  163.  
  164. RS.Parent = nil
  165.  
  166. LS.Parent = nil
  167.  
  168. RA.Anchored = true
  169.  
  170. LA.Anchored = true
  171.  
  172. local Place0 = T.CFrame
  173.  
  174. local H1 = hp1x and hp1 or mouse.Hit.p
  175.  
  176. local H2 = hp2x and hp2 or mouse.Hit.p
  177.  
  178. Place0 = Place0 + ((Place0*CFrame.Angles(math.pi/2,0,0)).lookVector * 0.5) + (Place0*CFrame.Angles(0,math.pi/2,0)).lookVector*1.5
  179.  
  180. local Place1 = Place0 + ((Place0.p-H1).unit*-2)
  181.  
  182. RA.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.Angles(-math.pi/2,0,0)
  183.  
  184. local Place0 = T.CFrame
  185.  
  186. Place0 = Place0 + ((Place0*CFrame.Angles(math.pi/2,0,0)).lookVector * 0.5) - (Place0*CFrame.Angles(0,math.pi/2,0)).lookVector*1.5
  187.  
  188. local Place1 = Place0 + ((Place0.p-H2).unit*-2)
  189.  
  190. LA.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.Angles(-math.pi/2,0,0)
  191.  
  192. T.CFrame = CFrame.new(T.Position, TP1:lerp(TP2, ((TP1-TP2).magnitude^(1/1.5) - 20)/100)*Vector3.new(1,0,1) + T.Position*Vector3.new(0,1,0))
  193.  
  194. else
  195.  
  196. sHand = nil
  197.  
  198. RS.Parent = T
  199.  
  200. LS.Parent = T
  201.  
  202. RA.Anchored = false
  203.  
  204. LA.Anchored = false
  205.  
  206. T.CFrame = CFrame.new(T.Position, TP1:lerp(TP2, ((TP1-TP2).magnitude^(1/1.5) - 10.8)/100)*Vector3.new(1,0,1) + T.Position*Vector3.new(0,1,0))
  207.  
  208. end
  209.  
  210. wait()
  211.  
  212. end
  213.  
  214. end)
  215.  
  216. end)
  217.  
  218.  
  219. local click = 0
  220.  
  221. Delay(0, function()
  222.  
  223. while wait(.5) do
  224.  
  225. cannon = (click ~= 0)
  226.  
  227. end
  228.  
  229. end)
  230.  
  231.  
  232. mouse.Button1Down:connect(function()
  233.  
  234. cannon = true
  235.  
  236. click = click + 1
  237.  
  238. Delay(.5, function() click = math.max(click-1, 0) end)
  239.  
  240. local part = Instance.new("Part")
  241.  
  242. part.Anchored = true
  243.  
  244. part.CanCollide = false
  245.  
  246. part.FormFactor = "Custom"
  247.  
  248. part.TopSurface, part.BottomSurface = "Smooth", "Smooth"
  249.  
  250. part.BrickColor = BrickColor.new("Lime green")
  251.  
  252. local p1, p2 = part:clone(), part:clone()
  253.  
  254. p1.Parent, p2.Parent = player.Character, player.Character
  255.  
  256. p1.Size = Vector3.new(.3,.3,1.5)
  257.  
  258. p2.Size = Vector3.new(.3,.3,1.5)
  259.  
  260. p1.CFrame = RA.CFrame
  261.  
  262. p2.CFrame = LA.CFrame
  263.  
  264. local C = mouse.Hit.p
  265.  
  266. local targ = mouse.Target
  267.  
  268. local CTDist = (C-targ.Position).magnitude
  269.  
  270. local RA1, LA1 = RA.Position, LA.Position
  271.  
  272. local Touched = false
  273.  
  274. local damage = function(hit)
  275.  
  276. if hit.Parent ~= player.Character and hit.Parent.Parent ~= player.Character then
  277.  
  278. pcall(function()
  279.  
  280. local h = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
  281.  
  282. if h then
  283.  
  284. h.MaxHealth = math.min(1e10, math.max(h.MaxHealth, 1))
  285.  
  286. h:TakeDamage(h.MaxHealth*.15)
  287.  
  288. end
  289.  
  290. end)
  291.  
  292. Touched = true
  293.  
  294. end
  295.  
  296. end
  297.  
  298. p1.Touched:connect(damage)
  299.  
  300. p2.Touched:connect(damage)
  301.  
  302. local targ = mouse.Target
  303.  
  304. local diff = (targ.Position - C).magnitude
  305.  
  306. for i = 0, 1, 1/(player.Character["Torso"].Position - C).magnitude*4 do
  307.  
  308. if not Touched then
  309.  
  310. p1.CFrame = CFrame.new(RA1:lerp(C, i), C)
  311.  
  312. p2.CFrame = CFrame.new(LA1:lerp(C, i), C)
  313.  
  314. wait()
  315.  
  316. end
  317.  
  318. end
  319.  
  320. if targ then
  321.  
  322. if math.abs((targ.Position - C).magnitude - diff) < 5 then
  323.  
  324. damage(targ)
  325.  
  326. end
  327.  
  328. end
  329.  
  330. for i = 0, 1, 1/10 do
  331.  
  332. wait()
  333.  
  334. local x1, x2 = p1.CFrame, p2.CFrame
  335.  
  336. p1.Size = p1.Size + Vector3.new(.2,.2,.2)
  337.  
  338. p2.Size = p1.Size
  339.  
  340. p1.CFrame = x1*CFrame.Angles(math.random(0, 100), math.random(0, 100), math.random(0, 100))
  341.  
  342. p2.CFrame = x2*CFrame.Angles(math.random(0, 100), math.random(0, 100), math.random(0, 100))
  343.  
  344. p1.Transparency = i
  345.  
  346. p2.Transparency = i
  347.  
  348. end
  349.  
  350. p1:Destroy()
  351.  
  352. p2:Destroy()
  353.  
  354. end)
Add Comment
Please, Sign In to add comment