Advertisement
EmeraldIT

Untitled

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