Advertisement
Darkraiii7

Untitled

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