Advertisement
EmeraldIT

WWIIINNNGGGGSSS!!!!

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