Advertisement
Guest User

Untitled

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