Advertisement
BAconTUbe

idk what is this but FE

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