Advertisement
Guest User

Untitled

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