Advertisement
-----------------

3DG rapid hand grappler thing fe maybe

Apr 29th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.82 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. --3DG
  153. --three dimensional grapples
  154. function clerp(c1,c2,al)
  155. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  156. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  157. for i,v in pairs(com1) do
  158. com1[i] = v+(com2[i]-v)*al
  159. end
  160. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  161. end
  162.  
  163. plr = game:service'Players'.LocalPlayer
  164. plrgui = plr.PlayerGui
  165. char = plr.Character
  166. mouse = plr:GetMouse()
  167. humanoid = char:findFirstChild("Humanoid")
  168. torso = char:findFirstChild("Torso")
  169. head = char.Head
  170. ra = char:findFirstChild("Right Arm")
  171. la = char:findFirstChild("Left Arm")
  172. rl = char:findFirstChild("Right Leg")
  173. ll = char:findFirstChild("Left Leg")
  174. rs = torso:findFirstChild("Right Shoulder")
  175. ls = torso:findFirstChild("Left Shoulder")
  176. rh = torso:findFirstChild("Right Hip")
  177. lh = torso:findFirstChild("Left Hip")
  178. neck = torso:findFirstChild("Neck")
  179. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  180. rootpart = char:findFirstChild("HumanoidRootPart")
  181. camera = workspace.CurrentCamera
  182. anim = char:findFirstChild("Animate")
  183. if anim then
  184. anim:Destroy()
  185. end
  186.  
  187. local lal = Instance.new('Sound', head)
  188. lal.SoundId = "rbxassetid://145048800"
  189. lal.Volume = 1
  190. lal:play()
  191. game:service'Debris':AddItem(lal, 8)
  192.  
  193. local rm = Instance.new("Weld", torso)
  194. rm.C0 = CFrame.new(1.5, 0.5, 0)
  195. rm.C1 = CFrame.new(0, 0.5, 0)
  196. rm.Part0 = torso
  197. rm.Part1 = ra
  198. rm.Name = 'Right Shoulder'
  199.  
  200. local lm = Instance.new("Weld", torso)
  201. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  202. lm.C1 = CFrame.new(0, 0.5, 0)
  203. lm.Part0 = torso
  204. lm.Part1 = la
  205. lm.Name = 'Left Shoulder'
  206.  
  207. local rlegm = Instance.new("Weld", torso)
  208. rlegm.C0 = CFrame.new(0.5, -1, 0)
  209. rlegm.C1 = CFrame.new(0, 1, 0)
  210. rlegm.Part0 = torso
  211. rlegm.Part1 = rl
  212.  
  213. local llegm = Instance.new("Weld", torso)
  214. llegm.C0 = CFrame.new(-0.5, -1, 0)
  215. llegm.C1 = CFrame.new(0, 1, 0)
  216. llegm.Part0 = torso
  217. llegm.Part1 = ll
  218.  
  219. rj.C0 = CFrame.new()
  220. rj.C1 = CFrame.new()
  221.  
  222. neck.C0 = CFrame.new(0, 1, 0)
  223. neck.C1 = CFrame.new(0, -0.5, 0)
  224.  
  225.  
  226. local speed = 0.3
  227. local angle = 0
  228. local anglespeed = 1
  229. rsc0 = rm.C0
  230. lsc0 = lm.C0
  231. llc0 = llegm.C0
  232. rlc0 = rlegm.C0
  233. rootc0 = rj.C0
  234. neckc0 = neck.C0
  235.  
  236. model = Instance.new('Model', char)
  237. model.Name = '3DG'
  238. function Weld(part0,part1,c1,c0)
  239. local w = Instance.new('Weld', model)
  240. w.Part0 = part0
  241. w.Part1 = part1
  242. w.C0 = c0 or CFrame.new()
  243. w.C1 = c1 or CFrame.new()
  244. end
  245.  
  246. local BasePart = Instance.new('Part')
  247. BasePart.FormFactor = 'Custom'
  248. BasePart.Material = 'Neon'
  249. BasePart.CanCollide = false
  250. BasePart.Locked = true
  251. BasePart.TopSurface = 10
  252. BasePart.BottomSurface = 10
  253. BasePart.LeftSurface = 10
  254. BasePart.RightSurface = 10
  255. BasePart.FrontSurface = 10
  256. BasePart.BackSurface = 10
  257. BasePart:breakJoints()
  258.  
  259.  
  260. for i = 1,2 do
  261. local strap = BasePart:clone()
  262. strap.Size = Vector3.new(1.025,.2,1.025)
  263. strap.Parent = model
  264. strap.BrickColor = BrickColor.new()
  265. strap:BreakJoints()
  266. Weld(strap, la, CFrame.new(0, .1 - i/3,0))
  267. end
  268.  
  269. for i = 1,2 do
  270. local strap = BasePart:clone()
  271. strap.Size = Vector3.new(1.025,.2,1.025)
  272. strap.Parent = model
  273. strap.BrickColor = BrickColor.new()
  274. strap:BreakJoints()
  275. Weld(strap, ra, CFrame.new(0, .1 - i/3,0))
  276. end
  277.  
  278. local ropeStart = BasePart:clone()
  279. ropeStart.Size = Vector3.new(.2,1.75,.2)
  280. ropeStart.Parent = model
  281. ropeStart.BrickColor = BrickColor.new()
  282. ropeStart:BreakJoints()
  283. Weld(ropeStart, ra, CFrame.new(-.45, -.5, 0))
  284. local ropeStart2 = BasePart:clone()
  285. ropeStart2.Size = Vector3.new(.2,1.75,.2)
  286. ropeStart2.Parent = model
  287. ropeStart2.BrickColor = BrickColor.new()
  288. ropeStart2:BreakJoints()
  289. Weld(ropeStart2, la, CFrame.new(.45, -.5, 0))
  290.  
  291. local ropeCont = BasePart:clone()
  292. ropeCont.Size = Vector3.new(.8,.2,.8)
  293. ropeCont.Parent = model
  294. ropeCont.BrickColor = BrickColor.new(199)
  295. ropeCont:BreakJoints()
  296. Instance.new('CylinderMesh', ropeCont)
  297. Weld(ropeCont, la, CFrame.new(.5, .05, 0), CFrame.Angles(math.pi/2, math.pi/2, 0))
  298. local ropeCont2 = BasePart:clone()
  299. ropeCont2.Size = Vector3.new(.8,.2,.8)
  300. ropeCont2.Parent = model
  301. ropeCont2.BrickColor = BrickColor.new(199)
  302. ropeCont2:BreakJoints()
  303. Instance.new('CylinderMesh', ropeCont2)
  304. Weld(ropeCont2, ra, CFrame.new(-.5, .05, 0), CFrame.Angles(math.pi/2, math.pi/2, 0))
  305.  
  306. local GasTank = BasePart:clone()
  307. GasTank.Size = Vector3.new(.8,1.4,.8)
  308. GasTank.Parent = model
  309. GasTank.BrickColor = BrickColor.new(194)
  310. GasTank:BreakJoints()
  311. Instance.new('SpecialMesh', GasTank)
  312. Weld(GasTank, ra, CFrame.new(0, -.25, .5))
  313. local GasTank2 = BasePart:clone()
  314. GasTank2.Size = Vector3.new(.8,1.4,.8)
  315. GasTank2.Parent = model
  316. GasTank2.BrickColor = BrickColor.new(194)
  317. GasTank2:BreakJoints()
  318. Instance.new('SpecialMesh', GasTank2)
  319. Weld(GasTank2, la, CFrame.new(0, -.25, .5))
  320.  
  321. local pa = BasePart:clone()
  322. pa.BrickColor = BrickColor.new()
  323. pa.Anchored = true
  324. pa.Size = Vector3.new(.5,1,.5)
  325. local special = Instance.new('SpecialMesh', pa)
  326. special.MeshId = "rbxassetid://1033714"
  327. special.Scale = Vector3.new(.25,2,.25)
  328. local ropePA = BasePart:clone()
  329. ropePA.Parent = pa
  330. ropePA.Anchored = true
  331. ropePA.BrickColor = BrickColor.new'White'
  332. Instance.new('CylinderMesh', ropePA).Scale = Vector3.new(.25,1,.25)
  333.  
  334. local pa2 = BasePart:clone()
  335. pa2.BrickColor = BrickColor.new()
  336. pa2.Anchored = true
  337. pa2.Size = Vector3.new(.5,1,.5)
  338. local special = Instance.new('SpecialMesh', pa2)
  339. special.MeshId = "rbxassetid://1033714"
  340. special.Scale = Vector3.new(.25,2,.25)
  341. local ropePA2 = BasePart:clone()
  342. ropePA2.Parent = pa2
  343. ropePA2.Anchored = true
  344. ropePA2.BrickColor = BrickColor.new'White'
  345. Instance.new('CylinderMesh', ropePA2).Scale = Vector3.new(.25,1,.25)
  346.  
  347. local pa3 = BasePart:clone()
  348. pa3.Transparency = 1
  349. pa3.Anchored = true
  350. pa3.Size = Vector3.new(2,2,2)
  351.  
  352. local torso3 = Instance.new('Part', char)
  353. torso3.Name = 'FakeTorsoForStuff'
  354. torso3.Size = torso.Size
  355. torso3.Transparency = 1
  356. torso3:breakJoints()
  357. Weld(torso3, torso)
  358.  
  359. Instance.new('PointLight', torso)
  360.  
  361. local jumpmode
  362.  
  363. local SGui = Instance.new('ScreenGui', plr.PlayerGui)
  364. local JumpButton = Instance.new('TextButton', SGui)
  365. JumpButton.BackgroundColor = BrickColor.new('Dark stone grey')
  366. JumpButton.BorderSizePixel = 4
  367. JumpButton.TextColor3 = Color3.new(1,1,1)
  368. JumpButton.BorderColor3 = Color3.new()
  369. JumpButton.TextStrokeTransparency = .5
  370. JumpButton.FontSize = 'Size12'
  371. JumpButton.Text = 'Thrust up when grappled'
  372. JumpButton.Size = UDim2.new(0, 250, 0, 50)
  373. JumpButton.Position = UDim2.new(1, -250, 1, -50)
  374. local OnOff = Instance.new('Frame', JumpButton)
  375. OnOff.BackgroundColor3 = Color3.new()
  376. OnOff.BorderSizePixel = 0
  377. OnOff.Size = UDim2.new(.8, 0, 0, 5)
  378. OnOff.Position = UDim2.new(.1, 0, 1, -10)
  379. JumpButton.MouseButton1Down:connect(function()
  380. jumpmode = not jumpmode
  381. if jumpmode then
  382. OnOff.BackgroundColor3 = Color3.new(0,1,0)
  383. else
  384. OnOff.BackgroundColor3 = Color3.new()
  385. end
  386. end)
  387.  
  388.  
  389.  
  390. local bodygyro = Instance.new('BodyGyro', torso)
  391. bodygyro.maxTorque = Vector3.new(14e16,14e16,14e16)
  392. bodygyro.P = 10000
  393.  
  394. ro=Instance.new("RocketPropulsion",rootpart)
  395. ro.Name = 'RockatPropoolsun'
  396. ro.MaxSpeed=200
  397. ro.MaxThrust=8000
  398. ro.TurnP = 0
  399. ro.MaxTorque=Vector3.new(14e16,14e16,14e16)
  400.  
  401. ro2=Instance.new("RocketPropulsion",torso)
  402. ro2.Name = 'RockatPropoolsun2'
  403. ro2.MaxSpeed=200
  404. ro2.MaxThrust=8000
  405. ro2.TurnP = 0
  406. ro2.MaxTorque=Vector3.new(14e16,14e16,14e16)
  407. local run
  408. mouse.KeyDown:connect(function(k)
  409. if k:byte() == 48 then
  410. run = not run
  411. if run then
  412. humanoid.WalkSpeed = 22
  413. else
  414. humanoid.WalkSpeed = 16
  415. end
  416. end
  417. if k:byte() == 32 then
  418. if Grapple1 or Grapple2 then
  419. wait()
  420. humanoid.PlatformStand = true
  421. rlegm.C0 = rlc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, .1)
  422. llegm.C0 = llc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, -.1)
  423. if pa3.Parent ~= nil then
  424. ro3:Fire()
  425. end
  426. if Grapple1 then
  427. ro:Fire()
  428. end
  429. if Grapple2 then
  430. ro2:Fire()
  431. end
  432. end
  433. end
  434. if k=="q" then
  435. local sound = Instance.new('Sound', head)
  436. sound.SoundId = "rbxassetid://160248505"
  437. sound.Pitch = 3+math.random()/3
  438. sound.Volume = .8
  439. sound:play()
  440. game:service'Debris':AddItem(sound,4)
  441. lm.Parent = torso
  442. pa.CFrame = la.CFrame
  443. local grapplepos = pa.Position
  444. local grapplevelocity = (mouse.Hit.p - grapplepos).unit*50
  445. local lastgrapplepos = pa.Position
  446. while wait() do
  447. lastgrapplepos = grapplepos
  448. grapplepos = grapplepos + grapplevelocity
  449. local RayCast = Ray.new(lastgrapplepos, (grapplepos - lastgrapplepos))
  450. local hit, hitpos = workspace:FindPartOnRay(RayCast, char)
  451. if (torso.Position - pa.Position).magnitude > 900 then
  452. pa.Parent = nil
  453. break
  454. end
  455. pa.Anchored = true
  456. pa.CFrame = CFrame.new(grapplepos, grapplepos+grapplevelocity) * CFrame.Angles(math.pi/2, 0, 0)
  457. pa.Parent = char
  458. if hit then
  459. local rotX,rotY,rotZ = pa.CFrame:toEulerAnglesXYZ()
  460. local sound = Instance.new('Sound', head)
  461. sound.SoundId = "rbxassetid://146466021"
  462. sound.Pitch = 1.2+math.random()/3
  463. sound.Volume = .25
  464. sound:play()
  465. game:service'Debris':AddItem(sound,4)
  466. pa.Parent = char
  467. pa.CFrame=CFrame.new(hitpos.x, hitpos.y, hitpos.z)*CFrame.Angles(rotX,rotY,rotZ)*CFrame.Angles(math.pi,0,0)
  468. ro.Target=pa
  469. lm.Parent = torso
  470. local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
  471. local hitz, enz = workspace:FindPartOnRay(ray, char)
  472. local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid'
  473. if hum then
  474. hum:TakeDamage(math.random(7,11))
  475. end
  476. local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid'
  477. if hum then
  478. hum:TakeDamage(math.random(7,11))
  479. end
  480. if pa.Parent ~= nil and humanoid.PlatformStand or not (hitz and hitz.CanCollide) then
  481. ro:Fire()
  482. if jumpmode then
  483. humanoid.Jump = true
  484. end
  485. end
  486. Gweld = Instance.new("Weld", char)
  487. Gweld.C0 = hit.CFrame:toObjectSpace(pa.CFrame)
  488. Gweld.Part0 = hit
  489. Gweld.Part1 = pa
  490. pa.Anchored = false
  491. Grapple1Hit = hit
  492. Grapple1 = true
  493. break
  494. end
  495. pa.Anchored = true
  496. pa.CFrame = CFrame.new(grapplepos, grapplepos+grapplevelocity) * CFrame.Angles(math.pi/2, 0, 0)
  497. end
  498. end
  499. if k=="e" then
  500. local sound = Instance.new('Sound', head)
  501. sound.SoundId = "rbxassetid://160248505"
  502. sound.Pitch = 3+math.random()/3
  503. sound.Volume = .8
  504. sound:play()
  505. game:service'Debris':AddItem(sound,4)
  506. pa2.CFrame = ra.CFrame
  507. rm.Parent = torso
  508. local grapplepos = pa2.Position
  509. local grapplevelocity = (mouse.Hit.p - grapplepos).unit*50
  510. local lastgrapplepos = pa2.Position
  511. while wait() do
  512. lastgrapplepos = grapplepos
  513. grapplepos = grapplepos + grapplevelocity
  514. local RayCast = Ray.new(lastgrapplepos, (grapplepos - lastgrapplepos))
  515. local hit, hitpos = workspace:FindPartOnRay(RayCast, char)
  516. if (torso.Position - pa2.Position).magnitude > 900 then
  517. pa2.Parent = nil
  518. break
  519. end
  520. pa2.Anchored = true
  521. pa2.CFrame = CFrame.new(grapplepos, grapplepos+grapplevelocity) * CFrame.Angles(math.pi/2, 0, 0)
  522. pa2.Parent = char
  523. if hit then
  524. local rotX,rotY,rotZ = pa2.CFrame:toEulerAnglesXYZ()
  525. local sound = Instance.new('Sound', head)
  526. sound.SoundId = "rbxassetid://146466021"
  527. sound.Pitch = 1.2+math.random()/3
  528. sound.Volume = .25
  529. sound:play()
  530. game:service'Debris':AddItem(sound,4)
  531. pa2.Parent = char
  532. pa2.CFrame=CFrame.new(hitpos.x, hitpos.y, hitpos.z)*CFrame.Angles(rotX,rotY,rotZ)*CFrame.Angles(math.pi,0,0)
  533. ro2.Target=pa2
  534. rm.Parent = torso
  535. local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
  536. local hitz, enz = workspace:FindPartOnRay(ray, char)
  537. local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid'
  538. if hum then
  539. hum:TakeDamage(math.random(7,11))
  540. end
  541. local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid'
  542. if hum then
  543. hum:TakeDamage(math.random(7,11))
  544. end
  545. if pa2.Parent ~= nil and humanoid.PlatformStand or not (hitz and hitz.CanCollide) then
  546. if jumpmode then
  547. humanoid.Jump = true
  548. end
  549. ro2:Fire()
  550. end
  551. Gweld2 = Instance.new("Weld", char)
  552. Gweld2.C0 = hit.CFrame:toObjectSpace(pa2.CFrame)
  553. Gweld2.Part0 = hit
  554. Gweld2.Part1 = pa2
  555. pa2.Anchored = false
  556. Grapple2Hit = hit
  557. Grapple2 = true
  558. break
  559. end
  560. pa2.Anchored = true
  561. pa2.CFrame = CFrame.new(grapplepos, grapplepos+grapplevelocity) * CFrame.Angles(math.pi/2, 0, 0)
  562. end
  563. end
  564. end)
  565.  
  566. mouse.KeyUp:connect(function(k)
  567. if k=="q" then
  568. pcall(function() Gweld:remove() end)
  569. game:service'RunService'.RenderStepped:wait()
  570. pcall(function() pa.Parent = nil Grapple1 = false end)
  571. pcall(function() ro:Abort() end)
  572. game:service'RunService'.RenderStepped:wait()
  573. pcall(function() ro2.Target=pa2 if Grapple2 and humanoid.PlatformStand or Grapple2 and not hitz then ro2:Fire() end end)
  574. elseif k=="e" then
  575. pcall(function() Gweld2:remove() end)
  576. game:service'RunService'.RenderStepped:wait()
  577. pcall(function() pa2.Parent = nil Grapple2 = false end)
  578. pcall(function() ro2:Abort() end)
  579. game:service'RunService'.RenderStepped:wait()
  580. pcall(function() ro.Target=pa if Grapple1 and humanoid.PlatformStand or Grapple1 and not hitz then ro:Fire() end end)
  581. end
  582. end)
  583.  
  584.  
  585. local MidPointUsed = false
  586. local TorsoSmoke = Instance.new('Smoke', torso)
  587.  
  588.  
  589. game:service'RunService'.RenderStepped:connect(function()
  590. angle = (angle % 100) + anglespeed/10
  591. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  592. local rscf = rsc0
  593. local lscf = lsc0
  594. local rlcf = rlc0
  595. local llcf = llc0
  596. local rjcf = rootc0
  597. local ncf = neckc0
  598. for i,object in pairs(char:children()) do
  599. if object:IsA("Tool") then
  600. tool = true
  601. if not debounce then
  602. for x,value in pairs(object:children()) do
  603. if value:IsA("StringValue") and value.Name == "toolanim" and value.Value == "Slash" then
  604. debounce = true
  605. coroutine.wrap(function()
  606. slashing = true
  607. wait(.25)
  608. slashing = false
  609. debounce = false
  610. end)()
  611. value:Destroy()
  612. end
  613. end
  614. end
  615. elseif not object:IsA'Tool' then
  616. tool = false
  617. end
  618. end
  619. if not humanoid.PlatformStand then
  620. if humanoid.Sit == true then
  621. speed = 0.2
  622. anglespeed = 1/4
  623. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  624. rjcf = rootc0
  625. rscf = rsc0 * CFrame.Angles(math.pi/2+math.sin(-angle)*0.05, 0, 0)
  626. lscf = lsc0 * CFrame.Angles(math.pi/2+math.sin(-angle)*0.05, 0, 0)
  627. rlcf = rlc0 * CFrame.Angles(math.pi/2+-math.rad(.2), 0, math.rad(.2))
  628. llcf = llc0 * CFrame.Angles(math.pi/2+math.rad(.2), 0, -math.rad(.2))
  629. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  630. anglespeed = 1/4
  631. speed = 0.2
  632. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.075, 0, 0)
  633. rjcf = rootc0
  634. rscf = rsc0 * CFrame.new(0, math.sin(angle)*0.05, 0) * CFrame.Angles(math.sin(-angle)*0.05, 0, 0)
  635. lscf = lsc0 * CFrame.new(0, math.sin(angle)*0.05, 0) * CFrame.Angles(math.sin(-angle)*0.05, 0, 0)
  636. rlcf = rlc0 * CFrame.Angles(-math.rad(.2), 0, math.rad(.2))
  637. llcf = llc0 * CFrame.Angles(math.rad(.2), 0, -math.rad(.2))
  638. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 20 then
  639. anglespeed = 1.7
  640. speed = 0.25
  641. anglespeed = 2.2
  642. speed = 0.25
  643. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  644. rjcf = rootc0 * CFrame.new(0, math.abs(math.sin(angle))*.055, 0) * CFrame.Angles(-math.rad(1), 0, 0)
  645. rscf = rsc0 * CFrame.Angles(math.sin(angle)*.5, 0, -math.rad(1))
  646. lscf = lsc0 * CFrame.Angles(math.sin(-angle)*.5, 0, math.rad(1))
  647. rlcf = rlc0 * CFrame.new(0, .075 + -math.cos(-angle)*.075, math.sin(angle)*0.1) * CFrame.Angles(math.sin(-angle)*.45, 0, math.rad(.5))
  648. llcf = llc0 * CFrame.new(0, .075 - -math.cos(angle)*.075, -math.sin(angle)*0.1) * CFrame.Angles(math.sin(angle)*.45, 0, -math.rad(.5))
  649. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
  650. local RotVelocityZ = torso.RotVelocity.Y
  651. if RotVelocityZ >= 15 then
  652. RotVelocityZ = 15
  653. elseif RotVelocityZ <= -15 then
  654. RotVelocityZ = -15
  655. end
  656. speed = 0.25
  657. anglespeed = 2.7
  658. ncf = neckc0 * CFrame.Angles(0, 0, -math.sin(angle)*.045)
  659. rscf = rsc0 * CFrame.new(0, 0, -math.sin(angle)*0.125) * CFrame.Angles(math.pi/14+math.sin(angle)*1.5, 0, -math.sin(math.abs(angle))*0.3)
  660. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/14+math.sin(-angle)*1.5, 0, -math.sin(math.abs(angle))*0.3)
  661. rjcf = rootc0 * CFrame.new(0, math.abs(math.sin(angle))*.175 - .2, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.055 + -math.pi/18, 0, math.rad(RotVelocityZ) + math.sin(angle)*.045)
  662. rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  663. llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  664. end
  665. if tool then
  666. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  667. if slashing then
  668. rscf = rsc0
  669. end
  670. end
  671. end
  672. if pa2.Parent == nil then
  673. rm.C0 = clerp(rm.C0,rscf,speed)
  674. end
  675. if pa.Parent == nil then
  676. lm.C0 = clerp(lm.C0,lscf,speed)
  677. end
  678. rj.C0 = clerp(rj.C0,rjcf,speed)
  679. neck.C0 = clerp(neck.C0,ncf,speed)
  680. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  681. llegm.C0 = clerp(llegm.C0,llcf,speed)
  682. end)
  683.  
  684.  
  685.  
  686. game:service'RunService'.RenderStepped:connect(function()
  687. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 225 then
  688. TorsoSmoke.Enabled = true
  689. else
  690. TorsoSmoke.Enabled = false
  691. end
  692. local ray = Ray.new(rootpart.Position, Vector3.new(0, -7, 0))
  693. local hitz, enz = workspace:FindPartOnRay(ray, char)
  694. if hitz and hitz.CanCollide and pa.Parent ~= char and pa2.Parent ~= char then
  695. bodygyro.Parent = nil
  696. humanoid.PlatformStand = false
  697. end
  698. if pa.Parent ~= nil or Grapple1 then
  699. local size = (ropeStart2.Position-pa.Position).magnitude
  700. ropePA.Size = Vector3.new(.2, size, .2)
  701. ropePA.CFrame = CFrame.new(ropeStart2.Position, pa.Position) * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0, -size/2, 0)
  702. lm.C0 = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(pa.Position)) * CFrame.Angles(math.pi/2, 0, 0)
  703. else
  704. if not debounce and humanoid.PlatformStand then
  705. lm.C0 = lsc0 * CFrame.Angles(-.15, 0, -.15)
  706. end
  707. end
  708. if pa2.Parent ~= nil or Grapple2 then
  709. local size = (ropeStart.Position-pa2.Position).magnitude
  710. ropePA2.Size = Vector3.new(.2, size, .2)
  711. ropePA2.CFrame = CFrame.new(ropeStart.Position, pa2.Position) * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0, -size/2, 0)
  712. rm.C0 = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(pa2.Position)) * CFrame.Angles(math.pi/2, 0, 0)
  713. else
  714. if not debounce and humanoid.PlatformStand then
  715. rm.C0 = rsc0 * CFrame.Angles(-.15, 0, .15)
  716. end
  717. end
  718. if Grapple1 and Grapple1Hit.Parent == nil then
  719. pcall(function() Gweld:remove() end)
  720. pa.Parent = nil
  721. Grapple1 = false
  722. ro:Abort()
  723. end
  724. if Grapple2 and Grapple2Hit.Parent == nil then
  725. pcall(function() Gweld2:remove() end)
  726. pa2.Parent = nil
  727. Grapple2 = false
  728. ro2:Abort()
  729. end
  730. if Grapple1 and Grapple2 and (humanoid.PlatformStand or not hitz) then
  731. local distance = (pa.Position-pa2.Position).magnitude
  732. bodygyro.Parent = torso
  733. torso.CFrame = CFrame.new(torso.Position, Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)) * CFrame.Angles(0, math.pi, 0)
  734. bodygyro.cframe = CFrame.new(torso.Position, Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)) * CFrame.Angles(0, math.pi, 0)
  735. pa3.Parent = char
  736. if distance <= .5 then
  737. pa3.CFrame = pa.CFrame
  738. elseif distance > .5 then
  739. pa3.CFrame = CFrame.new(pa.Position, pa2.Position) * CFrame.new(0, 0, -distance/2)
  740. end
  741. if not MidPointUsed then
  742. ro3=Instance.new("RocketPropulsion",torso3)
  743. ro3.Name = 'RockatPropoolsun3'
  744. ro3.MaxSpeed=250
  745. ro3.MaxThrust=16000
  746. ro3.TurnP = 0
  747. ro3.TurnD = 0
  748. ro3.MaxTorque=Vector3.new(14e16,14e16,14e16)
  749. if humanoid.PlatformStand or not hitz then
  750. ro:Abort()
  751. ro2:Abort()
  752. end
  753. ro3.Target = pa3
  754. if humanoid.PlatformStand or not hitz then
  755. ro3:Fire()
  756. end
  757. MidPointUsed = true
  758. end
  759. elseif (not Grapple1 or not Grapple2) and MidPointUsed == true and (humanoid.PlatformStand or not hitz) then
  760. pa3.Parent = nil
  761. MidPointUsed = false
  762. ro3:Abort()
  763. ro3:Destroy()
  764. if Grapple1 then
  765. ro:Fire()
  766. end
  767. if Grapple2 then
  768. ro2:Fire()
  769. end
  770. end
  771. if not Grapple1 then
  772. pcall(function() Gweld:remove() end)
  773. end
  774. if not Grapple2 then
  775. pcall(function() Gweld2:remove() end)
  776. end
  777. if (Grapple1 or Grapple2) and not hitz then
  778. bodygyro.Parent = torso
  779. humanoid.PlatformStand = true
  780. rlegm.Parent = torso
  781. llegm.Parent = torso
  782. lm.Parent = torso
  783. rm.Parent = torso
  784. rlegm.C0 = rlc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, .1)
  785. llegm.C0 = llc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, -.1)
  786. end
  787. if (Grapple1 or Grapple2) and not hitz or humanoid.PlatformStand then
  788. bodygyro.Parent = torso
  789. bodygyro.cframe = CFrame.new(torso.Position, Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)) * CFrame.Angles(0, math.pi, 0)
  790. rlegm.Parent = torso
  791. llegm.Parent = torso
  792. rlegm.C0 = rlc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, .1)
  793. llegm.C0 = llc0 * CFrame.new(0, .5, -.65) * CFrame.Angles(-math.pi/8, 0, -.1)
  794. end
  795. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement