Advertisement
cifrovoj

Untitled

Oct 4th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1.  
  2. Me = game.Players.epicikr
  3.  
  4. Char = Me.Character
  5.  
  6. Name = "xSGrapple"
  7.  
  8. ToolName = "Grapple"
  9.  
  10. Hold = false
  11.  
  12. ButtonDown = false
  13.  
  14. NeckO = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  15.  
  16.  
  17.  
  18.  
  19.  
  20. function Prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  21.  
  22. part.Parent = parent
  23.  
  24. part.formFactor = form
  25.  
  26. part.CanCollide = collide
  27.  
  28. part.Transparency = tran
  29.  
  30. part.Reflectance = ref
  31.  
  32. part.Size = Vector3.new(x,y,z)
  33.  
  34. part.BrickColor = BrickColor.new(color)
  35.  
  36. part.TopSurface = 0
  37.  
  38. part.BottomSurface = 0
  39.  
  40. part.Anchored = anchor
  41.  
  42. part.Locked = true
  43.  
  44. part:BreakJoints()
  45.  
  46. end
  47.  
  48.  
  49.  
  50. function Weld(w, p, p1, a, b, c, x, y, z)
  51.  
  52. w.Parent = p
  53.  
  54. w.Part0 = p
  55.  
  56. w.Part1 = p1
  57.  
  58. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  59.  
  60. end
  61.  
  62.  
  63.  
  64. function GetCF(pos1, pos2)
  65.  
  66. local pos4 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
  67.  
  68. return CFrame.new(pos1, pos4)
  69.  
  70. end
  71.  
  72.  
  73.  
  74. function SetWeld(rw, R0, TO, mouse)
  75.  
  76. local offset = (TO.Position.Y - mouse.Hit.p.Y)/60
  77.  
  78. local mag = (TO.Position - mouse.Hit.p).magnitude/80
  79.  
  80. offset = offset/mag
  81.  
  82.  
  83.  
  84. TO.Neck.C0 = NeckO * CFrame.Angles(offset, 0, 0)
  85.  
  86.  
  87.  
  88. rw.C0 = R0 * CFrame.Angles(-offset, 0, 0)
  89.  
  90. end
  91.  
  92.  
  93.  
  94. Rarm = Char:findFirstChild("Right Arm")
  95.  
  96. Larm = Char:findFirstChild("Left Arm")
  97.  
  98. Torso = Char:findFirstChild("Torso")
  99.  
  100. Hum = Char:findFirstChild("Humanoid")
  101.  
  102.  
  103.  
  104. BG = Instance.new("BodyGyro")
  105.  
  106. BG.P = 10000
  107.  
  108. BG.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  109.  
  110.  
  111.  
  112. for i,v in pairs(Char:children()) do
  113.  
  114. if v.Name == Name then v:remove() end
  115.  
  116. end
  117.  
  118.  
  119.  
  120. Mod = Instance.new("Model")
  121.  
  122. Mod.Name = Name
  123.  
  124.  
  125.  
  126. Trail = Instance.new("Part")
  127.  
  128. Prop( Trail, nil, false, 0, 0, 0.3, 1, 0.3, "Reddish brown", false, "Custom" )
  129.  
  130. TrailMesh = Instance.new("CylinderMesh",Trail)
  131.  
  132.  
  133.  
  134. Main = Instance.new("Part")
  135.  
  136. Prop( Main, Mod, false, 0, 0, 0.6, 1.4, 0.6, "Dark green", false, "Custom" )
  137.  
  138. Instance.new("SpecialMesh",Main).MeshType = "Sphere"
  139.  
  140.  
  141.  
  142. TorsoHold = Instance.new("Weld")
  143.  
  144. Weld( TorsoHold, Torso, Main, math.pi*1.2, 0, 0, -1.1, 0.7, 0.3 )
  145.  
  146.  
  147.  
  148. Neck = Instance.new("Part")
  149.  
  150. Prop( Neck, Mod, false, 0, 0.1, 0.4, 1, 0.4, "Medium grey", false, "Custom" )
  151.  
  152. Instance.new("CylinderMesh",Neck)
  153.  
  154.  
  155.  
  156. NeckWeld = Instance.new("Weld")
  157.  
  158. Weld( NeckWeld, Main, Neck, 0, 0, 0, 0, -0.8, 0 )
  159.  
  160.  
  161.  
  162. for i = -60, 180, 20 do
  163.  
  164. local Hook = Instance.new("Part")
  165.  
  166. Prop( Hook, Mod, false, 0, 0.1, 0.3, 0.3, 0.3, "Medium grey", false, "Custom" )
  167.  
  168. Instance.new("CylinderMesh",Hook)
  169.  
  170.  
  171.  
  172. local HookW = Instance.new("Weld")
  173.  
  174. HookW.C0 = CFrame.new(-0.1, 1, 0) * CFrame.Angles(math.rad(i) - math.pi/1.7,0,0)
  175.  
  176. Weld( HookW, Neck, Hook, 0, 0, 0, 0, 0, -0.7 )
  177.  
  178. end
  179.  
  180.  
  181.  
  182. Hb = Instance.new("Part")
  183.  
  184. Prop( Hb, Mod, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  185.  
  186. Hbw = Instance.new("Weld")
  187.  
  188. Weld( Hbw, Rarm, Hb, 0, 0, 0, 0, 1, 0)
  189.  
  190.  
  191.  
  192. HW = Instance.new("Weld")
  193.  
  194. Weld( HW, Hb, nil, -math.pi/2 - 0.7, 0, 0, 0, 0, 0)
  195.  
  196.  
  197.  
  198. Rb = Instance.new("Part")
  199.  
  200. Prop( Rb, Mod, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  201.  
  202. Rh = Instance.new("Weld")
  203.  
  204. Weld( Rh, Torso, Rb, 0, 0, 0, -1.5, -0.5, 0)
  205.  
  206.  
  207.  
  208. Lb = Instance.new("Part")
  209.  
  210. Prop( Lb, Mod, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  211.  
  212. Lh = Instance.new("Weld")
  213.  
  214. Weld( Lh, Torso, Lb, 0, 0, 0, 1.5, -0.5, 0)
  215.  
  216.  
  217.  
  218. RW = Instance.new("Weld")
  219.  
  220. Weld(RW,Rb,nil,0,0,0,0,0.5,0)
  221.  
  222.  
  223.  
  224. LW = Instance.new("Weld")
  225.  
  226. Weld(LW,Lb,nil,0,0,0,0,0.5,0)
  227.  
  228.  
  229.  
  230. RightBattle = nil
  231.  
  232. LeftBattle = nil
  233.  
  234. WepBattle = nil
  235.  
  236.  
  237.  
  238. Mod.Parent = Char
  239.  
  240.  
  241.  
  242. if script.Parent.className ~= "HopperBin" then
  243.  
  244. Hop = Instance.new("HopperBin")
  245.  
  246. Hop.Name = ToolName
  247.  
  248. Hop.Parent = Me.Backpack
  249.  
  250. script.Parent = Hop
  251.  
  252. end
  253.  
  254.  
  255.  
  256. bin = script.Parent
  257.  
  258.  
  259.  
  260. function HoldArm()
  261.  
  262. RW.Part1 = Rarm
  263.  
  264. LW.Part1 = Larm
  265.  
  266. TorsoHold.Part1 = nil
  267.  
  268. HW.Part1 = Main
  269.  
  270. end
  271.  
  272.  
  273.  
  274. function HoldTorso()
  275.  
  276. RW.Part1 = nil
  277.  
  278. LW.Part1 = nil
  279.  
  280. TorsoHold.Part1 = Main
  281.  
  282. HW.Part1 = nil
  283.  
  284. end
  285.  
  286.  
  287.  
  288. function Normalize()
  289.  
  290. RW.C0 = RightBattle
  291.  
  292. LW.C0 = LeftBattle
  293.  
  294. HW.C0 = WepBattle
  295.  
  296. Torso.Neck.C0 = NeckO
  297.  
  298. end
  299.  
  300.  
  301.  
  302. function SelectMotion()
  303.  
  304. HoldArm()
  305.  
  306. for i = 0, 40, 5 do
  307.  
  308. RW.C0 = CFrame.Angles(math.rad(i), 0, 0)
  309.  
  310. HW.C0 = CFrame.Angles(math.rad(i*4), 0, 0)
  311.  
  312. wait()
  313.  
  314. end
  315.  
  316. if RightBattle == nil then
  317.  
  318. RightBattle = RW.C0
  319.  
  320. WepBattle = HW.C0
  321.  
  322. LeftBattle = LW.C0
  323.  
  324. end
  325.  
  326. Normalize()
  327.  
  328. end
  329.  
  330.  
  331.  
  332. function DeselMotion()
  333.  
  334. HoldTorso()
  335.  
  336. end
  337.  
  338.  
  339.  
  340. function Throw(Mouse)
  341.  
  342. Hold = true
  343.  
  344. for i = 0, 120, 15 do
  345.  
  346. RW.C0 = RightBattle * CFrame.Angles(math.rad(i), 0, 0)
  347.  
  348. wait()
  349.  
  350. end
  351.  
  352. local co = RW.C0
  353.  
  354. BG.Parent = Torso
  355.  
  356. Mouse.Button1Up:connect(function()
  357.  
  358. Hold = false
  359.  
  360. BG.Parent = nil
  361.  
  362. end)
  363.  
  364. while Hold do
  365.  
  366. BG.cframe = GetCF(Torso.Position, Mouse.Hit.p)
  367.  
  368. SetWeld(RW, co, Torso, Mouse)
  369.  
  370. wait()
  371.  
  372. end
  373.  
  374. local Wn = RW.C0
  375.  
  376. for i = 0, -60, -20 do
  377.  
  378. RW.C0 = Wn * CFrame.Angles(math.rad(i), 0, 0)
  379.  
  380. wait()
  381.  
  382. end
  383.  
  384. Wn = RW.C0
  385.  
  386. HW.Part1 = nil
  387.  
  388. local BF = Instance.new("BodyForce",Main)
  389.  
  390. BF.force = Vector3.new(0,70,0)
  391.  
  392. local Mag = (Torso.Position - Mouse.Hit.p).magnitude
  393.  
  394. if Mag > 100 then Mag = 100 end
  395.  
  396. local Lol = CFrame.new(Torso.Position, Mouse.Hit.p) * CFrame.Angles(math.pi/8,0,0) * CFrame.new(0,0,-Mag/3)
  397.  
  398. Main.CanCollide = true
  399.  
  400. local BP = Instance.new("BodyPosition",Main)
  401.  
  402. BP.position = Lol.p
  403.  
  404. BP.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  405.  
  406. BP.P = 7000
  407.  
  408. wait()
  409.  
  410. BP:remove()
  411.  
  412. Trail.Parent = Mod
  413.  
  414. local touched = nil
  415.  
  416. Main.Touched:connect(function(h)
  417.  
  418. if h.CanCollide and h:GetMass() > 30 and touched == nil then
  419.  
  420. touched = h
  421.  
  422. end
  423.  
  424. end)
  425.  
  426. repeat
  427.  
  428. local ma = (Torso.Position - Main.Position).magnitude
  429.  
  430. TrailMesh.Scale = Vector3.new(1,ma,1)
  431.  
  432. Trail.CFrame = CFrame.new(Torso.Position, Main.Position) * CFrame.Angles(math.pi/2,0,0) * CFrame.new(0,-ma/2,0)
  433.  
  434. wait()
  435.  
  436. until touched ~= nil
  437.  
  438. local bpz = Instance.new("BodyPosition",Main)
  439.  
  440. bpz.P = 15000
  441.  
  442. bpz.position = Main.Position
  443.  
  444. bpz.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  445.  
  446. local bgz = Instance.new("BodyGyro",Main)
  447.  
  448. bgz.P = 5000
  449.  
  450. bgz.cframe = CFrame.new(Main.Position, Main.CFrame * CFrame.new(0,0,-2).p)
  451.  
  452. bgz.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  453.  
  454. for i = 0, 60, 10 do
  455.  
  456. RW.C0 = Wn * CFrame.Angles(math.rad(-i), 0, math.rad(-i/1.5)) * CFrame.new(0,math.rad(-i/1.5),0)
  457.  
  458. LW.C0 = LeftBattle * CFrame.Angles(math.rad(i*1.2), 0, math.rad(i/1.5)) * CFrame.new(0,math.rad(-i),0)
  459.  
  460. wait()
  461.  
  462. end
  463.  
  464. local bpp = Instance.new("BodyPosition",Torso)
  465.  
  466. bpp.P = 11000
  467.  
  468. bpp.position = Main.Position
  469.  
  470. bpp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  471.  
  472. repeat wait() until (Torso.Position - Main.Position).magnitude < 15
  473.  
  474. bpz:remove()
  475.  
  476. bgz:remove()
  477.  
  478. bpp:remove()
  479.  
  480. Normalize()
  481.  
  482. Trail.Parent = nil
  483.  
  484. end
  485.  
  486.  
  487.  
  488. function Select(mouse)
  489.  
  490. SelectMotion()
  491.  
  492. mouse.Button1Down:connect(function() Throw(mouse) end)
  493.  
  494. end
  495.  
  496.  
  497.  
  498. function Desel()
  499.  
  500. DeselMotion()
  501.  
  502. end
  503.  
  504.  
  505.  
  506. bin.Selected:connect(Select)
  507.  
  508. bin.Deselected:connect(Desel)
  509.  
  510.  
  511.  
  512. --Mediafire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement