EmeraldIT

Untitled

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