EmeraldIT

Untitled

May 24th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.24 KB | None | 0 0
  1. --[[
  2. Script shared by eletronix ]]
  3.  
  4. --Press Space twice to fly
  5. --Press Q to go down
  6. --Press A twice for a Wings spin
  7. --Press D twice for a Wings spin
  8.  
  9.  
  10. script.Parent = nil
  11.  
  12. function fly()
  13.  
  14. for i,v in pairs(script:GetChildren()) do
  15.  
  16. pcall(function() v.Value = "" end)
  17.  
  18. game:GetService("Debris"):AddItem(v,.1)
  19.  
  20. end
  21.  
  22. function weld(p0,p1,c0,c1,par)
  23.  
  24. local w = Instance.new("Weld",p0 or par)
  25.  
  26. w.Part0 = p0
  27.  
  28. w.Part1 = p1
  29.  
  30. w.C0 = c0 or CFrame.new()
  31.  
  32. w.C1 = c1 or CFrame.new()
  33.  
  34. return w
  35.  
  36. end
  37.  
  38. local motors = {}
  39.  
  40. function motor(p0,p1,c0,c1,des,vel,par)
  41.  
  42. local w = Instance.new("Motor6D",p0 or par)
  43.  
  44. w.Part0 = p0
  45.  
  46. w.Part1 = p1
  47.  
  48. w.C0 = c0 or CFrame.new()
  49.  
  50. w.C1 = c1 or CFrame.new()
  51.  
  52. w.MaxVelocity = tonumber(vel) or .05
  53.  
  54. w.DesiredAngle = tonumber(des) or 0
  55.  
  56. return w
  57.  
  58. end
  59.  
  60. function lerp(a,b,c)
  61.  
  62. return a+(b-a)*c
  63.  
  64. end
  65.  
  66. function clerp(c1,c2,al)
  67.  
  68. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  69.  
  70. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  71.  
  72. for i,v in pairs(com1) do
  73.  
  74. com1[i] = lerp(v,com2[i],al)
  75.  
  76. end
  77.  
  78. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  79.  
  80. end
  81.  
  82. function ccomplerp(c1,c2,al)
  83.  
  84. local com1 = {c1:components()}
  85.  
  86. local com2 = {c2:components()}
  87.  
  88. for i,v in pairs(com1) do
  89.  
  90. com1[i] = lerp(v,com2[i],al)
  91.  
  92. end
  93.  
  94. return CFrame.new(unpack(com1))
  95.  
  96. end
  97.  
  98. function tickwave(time,length,offset)
  99.  
  100. return (math.abs((tick()+(offset or 0))%time-time/2)*2-time/2)/time/2*length
  101.  
  102. end
  103.  
  104. function invcol(c)
  105.  
  106. c = c.Color
  107.  
  108. return BrickColor.new(Color3.new(1-c.b,1-c.g,1-c.r))
  109.  
  110. end
  111.  
  112. local oc = oc or function(...) return ... end
  113.  
  114. local plr = owner
  115.  
  116. repeat print("Waiting for character") wait() until plr.Character
  117.  
  118. local char = plr.Character
  119.  
  120. local tor = plr.Character.Torso
  121.  
  122. local hum = char.Humanoid
  123.  
  124. hum.PlatformStand = false
  125.  
  126. pcall(function()
  127.  
  128. char.Wings:Destroy()
  129.  
  130. end)
  131.  
  132. pcall(function()
  133.  
  134. char.Angel:Destroy() -- hat
  135.  
  136. end)
  137.  
  138. local mod = Instance.new("Model",char)
  139.  
  140. mod.Name = "Wings"
  141.  
  142. local special = {
  143.  
  144. --antiboomz0r = {"Really black","Institutional white",0,0,false,Color3.new(1,1,.95),Color3.new(1,1,.6)},
  145.  
  146. antiboomz0r = {"New Yeller",nil,0.4,0.7,true,Color3.new(1,1,.95),Color3.new(1,1,.6)},
  147.  
  148. --antiboomz0r = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  149.  
  150. taart = {"Royal purple",nil,.4,.4,true},
  151.  
  152. mitta = {"Black",nil,0,0,false},
  153.  
  154. penjuin3 = {"White",nil,0,0,false},
  155.  
  156. thepc8110 = {"Black","Bright red",.5,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  157.  
  158. nonspeaker = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  159.  
  160. littleau999 = {"Reddish brown",1030,0,0,false},
  161.  
  162. unscripter = {"Really black","Really black",.2,0,true,Color3.new(0,0,0),Color3.new(0,0,0)},
  163.  
  164. oxcool1 = {"Really black","White",.2,0,false,Color3.new(0,0,0),Color3.new(0,0,0)},
  165.  
  166. krodmiss = {"Really black",nil,0,0,false},
  167.  
  168. }
  169.  
  170. local topcolor = BrickColor.new("Pink")
  171.  
  172. local feacolor = BrickColor.new("Really black")
  173.  
  174. local ptrans = 0
  175.  
  176. local pref = 0
  177.  
  178. local fire = false
  179.  
  180. local fmcol = Color3.new(1,0.5,1)
  181.  
  182. local fscol = Color3.new(0.5,1,1)
  183.  
  184. local spec = special[plr.Name:lower()]
  185.  
  186. if spec then
  187.  
  188. topcolor,feacolor,ptrans,pref,fire,fmcol,fscol = spec[1] and BrickColor.new(spec[1]) or topcolor,spec[2] and BrickColor.new(spec[2]) or feacolor,spec[3],spec[4],spec[5],spec[6],spec[7]
  189.  
  190. end
  191.  
  192. local part = Instance.new("Part")
  193.  
  194. part.FormFactor = "Custom"
  195.  
  196. part.Size = Vector3.new(.2,.2,.2)
  197.  
  198. part.TopSurface,part.BottomSurface = 0,0
  199.  
  200. part.CanCollide = false
  201.  
  202. part.Material = "Neon"
  203.  
  204. part.BrickColor = topcolor
  205.  
  206. part.Transparency = ptrans
  207.  
  208. part.Reflectance = pref
  209.  
  210. local ef = Instance.new("Fire",fire and part or nil)
  211.  
  212. ef.Size = .15
  213.  
  214. ef.Color = fmcol or Color3.new()
  215.  
  216. ef.SecondaryColor = fscol or Color3.new()
  217.  
  218. part:BreakJoints()
  219.  
  220.  
  221. function newpart()
  222.  
  223. local clone = part:Clone()
  224.  
  225. clone.Parent = mod
  226.  
  227. clone:BreakJoints()
  228.  
  229. return clone
  230.  
  231. end
  232.  
  233. local feath = newpart()
  234.  
  235. feath.BrickColor = feacolor
  236.  
  237. feath.Transparency = ptrans
  238.  
  239. Instance.new("SpecialMesh",feath).MeshType = "Sphere"
  240.  
  241. function newfeather()
  242.  
  243. local clone = feath:Clone()
  244.  
  245. clone.Parent = mod
  246.  
  247. clone:BreakJoints()
  248.  
  249. trail = Instance.new("Trail")
  250. trail.Color = ColorSequence.new(Color3.new(0,0,0), Color3.new(1,0,1))
  251. trail.FaceCamera = true
  252. trail.Lifetime = 2
  253. trail.LightEmission = 0
  254. trail.LightInfluence = false
  255. trail.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0), NumberSequenceKeypoint.new(0.9,0), NumberSequenceKeypoint.new(1,1)})
  256. attach = Instance.new("Attachment")
  257. attach.Parent = clone
  258. attach.Position = Vector3.new(0,clone.Size.Y/2,0)
  259. attach2 = Instance.new("Attachment")
  260. attach2.Parent = clone
  261. attach2.Position = Vector3.new(0,-(clone.Size.Y/2),0)
  262. trail.Parent = clone
  263. trail.Attachment0 = attach
  264. trail.Attachment1 = attach2
  265.  
  266. return clone
  267.  
  268. end
  269.  
  270.  
  271. ---------- RIGHT WING
  272.  
  273. local r1 = newpart()
  274.  
  275. r1.Size = Vector3.new(.3,1.5,.3)*1.2
  276.  
  277. local rm1 = motor(tor,r1,CFrame.new(.35,.6,.4) * CFrame.Angles(0,0,math.rad(-60)) * CFrame.Angles(math.rad(30),math.rad(-25),0),CFrame.new(0,-.8,0),.1)
  278.  
  279. local r2 = newpart()
  280.  
  281. r2.Size = Vector3.new(.4,1.8,.4)*1.2
  282.  
  283. local rm2 = motor(r1,r2,CFrame.new(0,.75,0) * CFrame.Angles(0,0,math.rad(50)) * CFrame.Angles(math.rad(-30),math.rad(15),0),CFrame.new(0,-.9,0),.1)
  284.  
  285. local r3 = newpart()
  286.  
  287. r3.Size = Vector3.new(.3,2.2,.3)*1.2
  288.  
  289. local rm3 = motor(r2,r3,CFrame.new(.1,.9,0) * CFrame.Angles(0,0,math.rad(-140)) * CFrame.Angles(math.rad(-3),0,0),CFrame.new(0,-1.1,0),.1)
  290.  
  291. local r4 = newpart()
  292.  
  293. r4.Size = Vector3.new(.25,1.2,.25)*1.2
  294.  
  295. local rm4 = motor(r3,r4,CFrame.new(0,1.1,0) * CFrame.Angles(0,0,math.rad(-10)) * CFrame.Angles(math.rad(-3),0,0),CFrame.new(0,-.6,0),.1)
  296.  
  297. local feather = newfeather()
  298.  
  299. feather.Mesh.Scale = Vector3.new(1,1,1)
  300.  
  301. feather.Size = Vector3.new(.4,3,.3)
  302.  
  303. weld(r4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
  304.  
  305. feather = newfeather()
  306.  
  307. feather.Mesh.Scale = Vector3.new(1,1,1)
  308.  
  309. feather.Size = Vector3.new(.4,2.3,.3)
  310.  
  311. weld(r4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
  312.  
  313. feather = newfeather()
  314.  
  315. feather.Mesh.Scale = Vector3.new(1,1,1)
  316.  
  317. feather.Size = Vector3.new(.35,2.2,.25)
  318.  
  319. weld(r4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
  320.  
  321. local rf3 = {}
  322.  
  323. for i=0,7 do
  324.  
  325. feather = newfeather()
  326.  
  327. feather.Mesh.Scale = Vector3.new(1,1,1)
  328.  
  329. feather.Size = Vector3.new(.45,2.2,.35)
  330.  
  331. table.insert(rf3,motor(r3,feather,CFrame.new(.05,1-i*.285,0) * CFrame.Angles(0,math.random()*.1,math.rad(-25-i*2)),CFrame.new(0,-feather.Size.Y/2,0)))
  332. wait(.2)
  333. end
  334.  
  335. local rf2 = {}
  336.  
  337. for i=0,6 do
  338.  
  339. feather = newfeather()
  340.  
  341. feather.Mesh.Scale = Vector3.new(1,1,1)
  342.  
  343. feather.Size = Vector3.new(.45,2.2-i*.08,.3)
  344.  
  345. table.insert(rf2,motor(r2,feather,CFrame.new(.05,.75-i*.26,0) * CFrame.Angles(0,math.random()*.1,math.rad(-75-i*4)),CFrame.new(0,-feather.Size.Y/2,0)))
  346. wait(.2)
  347. end
  348.  
  349. local rf1 = {}
  350.  
  351. for i=0,6 do
  352.  
  353. feather = newfeather()
  354.  
  355. feather.Mesh.Scale = Vector3.new(1,1,1)
  356.  
  357. feather.Size = Vector3.new(.37,1.65-i*.06,.25)
  358.  
  359. table.insert(rf1,motor(r1,feather,CFrame.new(.05,.63-i*.21,0) * CFrame.Angles(0,math.random()*.05,math.rad(-75)),CFrame.new(0,-feather.Size.Y/2,0)))
  360. wait(.2)
  361. end
  362.  
  363. ---------- LEFT WING
  364.  
  365. local l1 = newpart()
  366.  
  367. l1.Size = Vector3.new(.3,1.5,.3)*1.2
  368.  
  369. local lm1 = motor(tor,l1,CFrame.new(-.35,.6,.4) * CFrame.Angles(0,0,math.rad(60)) * CFrame.Angles(math.rad(30),math.rad(25),0) * CFrame.Angles(0,-math.pi,0),CFrame.new(0,-.8,0) ,.1)
  370.  
  371. local l2 = newpart()
  372.  
  373. l2.Size = Vector3.new(.4,1.8,.4)*1.2
  374.  
  375. local lm2 = motor(l1,l2,CFrame.new(0,.75,0) * CFrame.Angles(0,0,math.rad(50)) * CFrame.Angles(math.rad(30),math.rad(-15),0),CFrame.new(0,-.9,0),.1)
  376.  
  377. local l3 = newpart()
  378.  
  379. l3.Size = Vector3.new(.3,2.2,.3)*1.2
  380.  
  381. local lm3 = motor(l2,l3,CFrame.new(.1,.9,0) * CFrame.Angles(0,0,math.rad(-140)) * CFrame.Angles(math.rad(3),0,0),CFrame.new(0,-1.1,0),.1)
  382.  
  383. local l4 = newpart()
  384.  
  385. l4.Size = Vector3.new(.25,1.2,.25)*1.2
  386.  
  387. local lm4 = motor(l3,l4,CFrame.new(0,1.1,0) * CFrame.Angles(0,0,math.rad(-10)) * CFrame.Angles(math.rad(3),0,0),CFrame.new(0,-.6,0),.1)
  388.  
  389. local feather = newfeather()
  390.  
  391. feather.Mesh.Scale = Vector3.new(1,1,1)
  392.  
  393. feather.Size = Vector3.new(.4,3,.3)
  394.  
  395. weld(l4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
  396.  
  397. feather = newfeather()
  398.  
  399. feather.Mesh.Scale = Vector3.new(1,1,1)
  400.  
  401. feather.Size = Vector3.new(.4,2.3,.3)
  402.  
  403. weld(l4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
  404.  
  405. feather = newfeather()
  406.  
  407. feather.Mesh.Scale = Vector3.new(1,1,1)
  408.  
  409. feather.Size = Vector3.new(.35,2.2,.25)
  410.  
  411. weld(l4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
  412.  
  413. local lf3 = {}
  414.  
  415. for i=0,7 do
  416.  
  417. feather = newfeather()
  418.  
  419. feather.Mesh.Scale = Vector3.new(1,1,1)
  420.  
  421. feather.Size = Vector3.new(.45,2.2,.35)
  422.  
  423. table.insert(lf3,motor(l3,feather,CFrame.new(.05,1-i*.285,0) * CFrame.Angles(0,math.random()*.1,math.rad(-25-i*2)),CFrame.new(0,-feather.Size.Y/2,0)))
  424. wait(.2)
  425. end
  426.  
  427. local lf2 = {}
  428.  
  429. for i=0,6 do
  430.  
  431. feather = newfeather()
  432.  
  433. feather.Mesh.Scale = Vector3.new(1,1,1)
  434.  
  435. feather.Size = Vector3.new(.45,2.2-i*.08,.3)
  436.  
  437. table.insert(lf2,motor(l2,feather,CFrame.new(.05,.75-i*.26,0) * CFrame.Angles(0,math.random()*.1,math.rad(-75-i*4)),CFrame.new(0,-feather.Size.Y/2,0)))
  438. wait(.2)
  439. end
  440.  
  441. local lf1 = {}
  442.  
  443. for i=0,6 do
  444.  
  445. feather = newfeather()
  446.  
  447. feather.Mesh.Scale = Vector3.new(1,1,1)
  448.  
  449. feather.Size = Vector3.new(.37,1.65-i*.06,.25)
  450.  
  451. table.insert(lf1,motor(l1,feather,CFrame.new(.05,.63-i*.21,0) * CFrame.Angles(0,math.random()*.05,math.rad(-75)),CFrame.new(0,-feather.Size.Y/2,0)))
  452. wait(.2)
  453. end
  454.  
  455. local rwing = {rm1,rm2,rm3,rm4}
  456.  
  457. local lwing = {lm1,lm2,lm3,lm4}
  458.  
  459. local oc0 = {}
  460.  
  461. for i,v in pairs(rwing) do
  462.  
  463. oc0[v] = v.C0
  464.  
  465. end
  466.  
  467. for i,v in pairs(lwing) do
  468.  
  469. oc0[v] = v.C0
  470.  
  471. end
  472.  
  473. function gotResized()
  474.  
  475. if lastsize then
  476.  
  477. if tor.Size == lastsize then return end -- This shouldn't happen?
  478.  
  479. local scaleVec = tor.Size/lastsize
  480.  
  481. for i,v in pairs(oc0) do
  482.  
  483. oc0[i] = v-v.p+scaleVec*v.p
  484.  
  485. end
  486.  
  487. lastsize = tor.Size
  488.  
  489. end
  490.  
  491. lastsize = tor.Size
  492.  
  493. end
  494.  
  495. tor.Changed:connect(function(p)
  496.  
  497. if p == "Size" then
  498.  
  499. gotResized()
  500.  
  501. end
  502.  
  503. end)
  504.  
  505. gotResized()
  506.  
  507. local idle = {0,0.5,-.2,0; .05,.05,.1,.05; -.6,-1.5,.1,0;}--0,.3,0,0
  508.  
  509. local outlow = {-.7,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
  510.  
  511. local outhigh = {.5,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
  512.  
  513. local veryhigh = {.9,-.3,1.9,0; .3,.05,.1,.05; .2,0,0,0}
  514.  
  515. local flap1 = {-.3,.3,1.1,-.2; .3,.05,.1,.05; .2,-.6,0,0}
  516.  
  517. local divebomb = {0,.2,.4,-.7; .3,.05,.1,.05; 0,-.5,-.6,0}
  518.  
  519.  
  520. function setwings(tab,timee)
  521.  
  522. timee = timee or 10
  523.  
  524. for i=1,4 do
  525.  
  526. rwing[i].DesiredAngle = tab[i]
  527.  
  528. lwing[i].DesiredAngle = tab[i]
  529.  
  530. rwing[i].MaxVelocity = math.abs(tab[i]-rwing[i].CurrentAngle)/timee
  531.  
  532. lwing[i].MaxVelocity = math.abs(tab[i]-lwing[i].CurrentAngle)/timee
  533.  
  534. local rcf = oc0[rwing[i]] * (tab[12+i] or CFrame.new())
  535.  
  536. local lcf = oc0[lwing[i]] * (tab[12+i] or CFrame.new())
  537.  
  538. end
  539.  
  540. for i,v in pairs(rf1) do
  541.  
  542. v.DesiredAngle = tab[9]
  543.  
  544. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  545.  
  546. end
  547.  
  548. for i,v in pairs(lf1) do
  549.  
  550. v.DesiredAngle = tab[9]
  551.  
  552. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  553.  
  554. end
  555.  
  556. for i,v in pairs(rf2) do
  557.  
  558. v.DesiredAngle = tab[10]
  559.  
  560. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  561.  
  562. end
  563.  
  564. for i,v in pairs(lf2) do
  565.  
  566. v.DesiredAngle = tab[10]
  567.  
  568. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  569.  
  570. end
  571.  
  572. for i,v in pairs(rf3) do
  573.  
  574. v.DesiredAngle = tab[11]
  575.  
  576. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  577.  
  578. end
  579.  
  580. for i,v in pairs(lf3) do
  581.  
  582. v.DesiredAngle = tab[11]
  583.  
  584. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/timee
  585.  
  586. end
  587.  
  588. end
  589.  
  590. setwings(outhigh,1)
  591.  
  592. flying = false
  593.  
  594. moving = false
  595.  
  596. for i,v in pairs(tor:GetChildren()) do
  597.  
  598. if v.ClassName:lower():match("body") then
  599.  
  600. v:Destroy()
  601.  
  602. end
  603.  
  604. end
  605.  
  606. local ctor = tor:Clone()
  607.  
  608. ctor:ClearAllChildren()
  609.  
  610. ctor.Name = "cTorso"
  611.  
  612. ctor.Transparency = 1
  613.  
  614. ctor.CanCollide = false
  615.  
  616. ctor.FormFactor = "Custom"
  617.  
  618. ctor.Size = Vector3.new(.2,.2,.2)
  619.  
  620. ctor.Parent = mod
  621.  
  622. weld(tor,ctor)
  623.  
  624. local bg = Instance.new("BodyGyro",ctor)
  625.  
  626. bg.maxTorque = Vector3.new()
  627.  
  628. bg.P = 15000
  629.  
  630. bg.D = 1000
  631.  
  632. local bv = Instance.new("BodyVelocity",ctor)
  633.  
  634. bv.maxForce = Vector3.new()
  635.  
  636. bv.P = 15000
  637.  
  638. vel = Vector3.new()
  639.  
  640. cf = CFrame.new()
  641.  
  642. flspd = 0
  643.  
  644.  
  645. keysdown = {}
  646.  
  647. keypressed = {}
  648.  
  649. ktime = {}
  650.  
  651. descendtimer = 0
  652.  
  653. jumptime = tick()
  654.  
  655. hum.Jumping:connect(function()
  656.  
  657. jumptime = tick()
  658.  
  659. end)
  660.  
  661. cam = workspace.CurrentCamera
  662. mouse = plr:GetMouse()
  663. kd = mouse.KeyDown:connect(function(key)
  664.  
  665. keysdown[key] = true
  666.  
  667. keypressed[key] = true
  668.  
  669. if key == "q" and hum.Jump then
  670.  
  671. descendtimer = tick()
  672.  
  673. elseif key == " " and not hum.Jump then
  674.  
  675. jumptime = tick()
  676.  
  677. elseif (key == "a" or key == "d") and ktime[key] and tick()-ktime[key] < 1 and math.abs(reqrotx) < 1 then
  678.  
  679. reqrotx = key == "a" and math.pi*2 or -math.pi*2
  680.  
  681. end
  682.  
  683. ktime[key] = tick()
  684.  
  685. end)
  686.  
  687. ku = mouse.KeyUp:connect(function(key)
  688.  
  689. keysdown[key] = false
  690.  
  691. if key == " " then
  692.  
  693. descendtimer = tick()
  694.  
  695. end
  696.  
  697. end)
  698.  
  699. function mid(a,b,c)
  700.  
  701. return math.max(a,math.min(b,c or -a))
  702.  
  703. end
  704.  
  705. function bn(a)
  706.  
  707. return a and 1 or 0
  708.  
  709. end
  710.  
  711. function gm(tar)
  712.  
  713. local m = 0
  714.  
  715. for i,v in pairs(tar:GetChildren()) do
  716.  
  717. if v:IsA("BasePart") then
  718.  
  719. m = m + v:GetMass()
  720.  
  721. end
  722.  
  723. m = m + gm(v)
  724.  
  725. end
  726.  
  727. return m
  728.  
  729. end
  730.  
  731. reqrotx = 0
  732.  
  733. local grav = 196.2
  734.  
  735. local con
  736.  
  737. con = game:GetService("RunService").RenderStepped:connect(function()
  738.  
  739. --[[if not mod:IsDescendantOf(workspace) then
  740.  
  741. pcall(function() kd:disconnect() end)
  742.  
  743. pcall(function() ku:disconnect() end)
  744.  
  745. bg:Destroy()
  746.  
  747. bv:Destroy()
  748.  
  749. con:disconnect()
  750.  
  751. script:Destroy()
  752.  
  753. return
  754.  
  755. end]]
  756.  
  757. local obvel = tor.CFrame:vectorToObjectSpace(tor.Velocity)
  758.  
  759. local sspd, uspd,fspd = obvel.X,obvel.Y,obvel.Z
  760.  
  761. if flying then
  762.  
  763. local lfldir = fldir
  764.  
  765. fldir = cam.CoordinateFrame:vectorToWorldSpace(Vector3.new(bn(keysdown.d)-bn(keysdown.a),0,bn(keysdown.s)-bn(keysdown.w))).unit
  766.  
  767. local lmoving = moving
  768.  
  769. moving = fldir.magnitude > .1
  770.  
  771. if lmoving and not moving then
  772.  
  773. idledir = lfldir*Vector3.new(1,0,1)
  774.  
  775. descendtimer = tick()
  776.  
  777. end
  778.  
  779. local dbomb = fldir.Y < -.6 or (moving and keysdown["1"])
  780.  
  781. if moving and keysdown["0"] and lmoving then
  782.  
  783. fldir = (Vector3.new(lfldir.X,math.min(fldir.Y,lfldir.Y+.01)-.1,lfldir.Z)+(fldir*Vector3.new(1,0,1))*.05).unit
  784.  
  785. end
  786.  
  787. local down = tor.CFrame:vectorToWorldSpace(Vector3.new(0,-1,0))
  788.  
  789. local descending = (not moving and keysdown["q"] and not keysdown[" "])
  790.  
  791. cf = ccomplerp(cf,CFrame.new(tor.Position,tor.Position+(not moving and idledir or fldir)),keysdown["0"] and .02 or .07)
  792.  
  793. local gdown = not dbomb and cf.lookVector.Y < -.2 and tor.Velocity.unit.Y < .05
  794.  
  795. hum.PlatformStand = true
  796.  
  797. bg.maxTorque = Vector3.new(1,1,1)*9e5
  798.  
  799. local rotvel = CFrame.new(Vector3.new(),tor.Velocity):toObjectSpace(CFrame.new(Vector3.new(),fldir)).lookVector
  800.  
  801. bg.cframe = cf * CFrame.Angles(not moving and -.1 or -math.pi/2+.2,moving and mid(-2.5,rotvel.X/1.5) + reqrotx or 0,0)
  802.  
  803. reqrotx = reqrotx - reqrotx/10
  804.  
  805. bv.maxForce = Vector3.new(1,1,1)*9e4*.5
  806.  
  807. local anioff =(bn(keysdown[" "])-bn(keysdown["q"]))/2
  808.  
  809. local ani = tickwave(1.5-anioff,1)
  810.  
  811. bv.velocity = bv.velocity:Lerp(Vector3.new(0,bn(not moving)*-ani*15+(descending and math.min(20,tick()-descendtimer)*-8 or bn(keysdown[" "])-bn(keysdown["q"]))*15,0)+vel,.6)
  812.  
  813. vel = moving and cf.lookVector*flspd or Vector3.new()
  814.  
  815. flspd = math.min(120,lerp(flspd,moving and (fldir.Y<0 and flspd+(-fldir.Y)*grav/60 or math.max(50,flspd-fldir.Y*grav/300)) or 60,.4))
  816.  
  817. setwings(moving and (gdown and outlow or dbomb and divebomb) or (descending and veryhigh or flap1),15)
  818.  
  819. for i=1,4 do
  820.  
  821. --CFrame.Angles(-.5+bn(i==3)*2.4+bn(i==4)*.5,.1+bn(i==2)*.5-bn(i==3)*1.1,bn(i==3)*.1)
  822.  
  823. rwing[i].C0 = clerp(rwing[i].C0,oc0[rwing[i]] * (gdown and CFrame.new() or dbomb and CFrame.Angles(-.5+bn(i==3)*.4+bn(i==4)*.5,.1+bn(i==2)*.5-bn(i==3)*1.1,bn(i==3)*.1) or descending and CFrame.Angles(.3,0,0) or CFrame.Angles((i*.1+1.5)*ani,ani*-.5,1*ani)),descending and .8 or .2)
  824.  
  825. lwing[i].C0 = clerp(lwing[i].C0,oc0[lwing[i]] * (gdown and CFrame.new() or dbomb and CFrame.Angles(-(-.5+bn(i==3)*.4+bn(i==4)*.5),-(.1+bn(i==2)*.5-bn(i==3)*1.1),bn(i==3)*.1) or descending and CFrame.Angles(-.3,0,0) or CFrame.Angles(-(i*.1+1.5)*ani,ani*.5,1*ani)),descending and .8 or .2)
  826.  
  827. end
  828.  
  829. local hit,ray = workspace:FindPartOnRayWithIgnoreList(Ray.new(tor.Position,Vector3.new(0,-3.5+math.min(0,bv.velocity.y)/30,0)),{char})
  830.  
  831. if hit and down.Y < -.85 and tick()-flystart > 1 then
  832.  
  833. flying = false
  834.  
  835. hum.PlatformStand = false
  836.  
  837. tor.Velocity = Vector3.new()
  838.  
  839. end
  840.  
  841. else
  842.  
  843. bg.maxTorque = Vector3.new()
  844.  
  845. bv.maxForce = Vector3.new()
  846.  
  847. local ani = tickwave(walking and .8 or 4.5,1)
  848.  
  849. setwings(idle,10)
  850.  
  851. local x,y,z = fspd/160,uspd/700,sspd/900
  852.  
  853. for i=1,4 do
  854.  
  855. rwing[i].C0 = clerp(rwing[i].C0,oc0[rwing[i]] * CFrame.Angles(ani*.1 + -mid(-.1,x),0 + -mid(-.1,y) + bn(i==2)*.6,ani*.02 + -mid(-.1,z)),.2)
  856.  
  857. lwing[i].C0 = clerp(lwing[i].C0,oc0[lwing[i]] * CFrame.Angles(ani*-.05 + mid(-.1,x),0 + mid(-.1,y) + -bn(i==2)*.6,ani*.02 + mid(-.1,z)),.2)
  858.  
  859. end
  860.  
  861. if keypressed[" "] and not flying and hum.Jump then
  862.  
  863. vel = Vector3.new(0,50,0)
  864.  
  865. bv.velocity = vel
  866.  
  867. idledir = cam.CoordinateFrame.lookVector*Vector3.new(1,0,1)
  868.  
  869. cf = tor.CFrame * CFrame.Angles(-.01,0,0)
  870.  
  871. tor.CFrame = cf
  872.  
  873. bg.cframe = cf
  874.  
  875. flystart = tick()
  876.  
  877. flying = true
  878.  
  879. end
  880.  
  881. end
  882.  
  883. keypressed = {}
  884.  
  885. end)
  886.  
  887.  
  888.  
  889. end fly()
  890.  
  891. --mediafire
Add Comment
Please, Sign In to add comment