Advertisement
DarkScriptZEditors

Untitled

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