Advertisement
Ban43_GodOfEdits

grapple?

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