Advertisement
Irongolen14

name it

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