Advertisement
UnoPastes

Wings

Mar 3rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.41 KB | None | 0 0
  1. -- Retributor, without all the fun stuff. Just the coat.
  2.  
  3. -- Written by yeox769.
  4.  
  5. wait(0.5)
  6. Player=game:GetService("Players").LocalPlayer
  7. Character=Player.Character
  8. PlayerGui=Player.PlayerGui
  9. Backpack=Player.Backpack
  10. Torso=Character.Torso
  11. Head=Character.Head
  12. Humanoid=Character.Humanoid
  13. m=Instance.new('Model',Character)
  14. LeftArm=Character["Left Arm"]
  15. LeftLeg=Character["Left Leg"]
  16. RightArm=Character["Right Arm"]
  17. RightLeg=Character["Right Leg"]
  18. LS=Torso["Left Shoulder"]
  19. LH=Torso["Left Hip"]
  20. RS=Torso["Right Shoulder"]
  21. RH=Torso["Right Hip"]
  22. Face = Head.face
  23. Neck=Torso.Neck
  24. it=Instance.new
  25. attacktype=1
  26. vt=Vector3.new
  27. cf=CFrame.new
  28. euler=CFrame.fromEulerAnglesXYZ
  29. angles=CFrame.Angles
  30. cloaked=false
  31. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  32. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  33. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  34. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  35. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  36. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  37. RootPart=Character.HumanoidRootPart
  38. RootJoint=RootPart.RootJoint
  39. RootCF=euler(-1.57,0,3.14)
  40. attack = false
  41. attackdebounce = false
  42. deb=false
  43. equipped=true
  44. hand=false
  45. MMouse=nil
  46. combo=0
  47. trispeed=.2
  48. attackmode='none'
  49. local idle=0
  50. local Anim="Idle"
  51.  
  52. it = Instance.new
  53.  
  54. local part = function(name,parent,brkclr,mtrl,rfl,trns,sz)
  55. local prt = it("Part",parent)
  56. prt.Name = name
  57. prt.CanCollide = false
  58. prt.BrickColor = BrickColor.new(brkclr)
  59. if brkclr == "Really black" and mtrl == "Neon" then prt.Color = Color3.new(0,0,0) end
  60. prt.Material = mtrl
  61. prt.Reflectance = rfl
  62. prt.Transparency = trns
  63. prt.Size = sz
  64. prt.Anchored = true
  65. return prt
  66. end
  67. local mesh = function(meshtype,parent,meshid,textureid,scale)
  68. local msh = it("SpecialMesh",parent)
  69. if meshtype == "FileMesh" then
  70. msh.MeshId = meshid
  71. msh.TextureId = textureid
  72. end
  73. msh.MeshType = meshtype
  74. msh.Scale = scale
  75. return(msh)
  76. end
  77. local weld = function(part1,part2,x1,y1,z1,x2,y2,z2)
  78. local w = it("Weld",part1)
  79. w.Part0 = part1
  80. w.Part1 = part2
  81. if part1.Anchored or part2.Anchored then
  82. part1.Anchored = false
  83. part2.Anchored = false
  84. end
  85. w.C0 = (CFrame.new(x1,y1,z1)*CFrame.Angles(math.rad(z2),math.rad(y2),math.rad(x2)))
  86. return(w)
  87. end
  88. local emit = function(parent,tex,startcolor, endcolor, startsize,endsize,lightem,emdir,lif,rate,speed,rotspeed,sprdang)
  89. local emm = it("ParticleEmitter",parent)
  90. emm.Texture = tex
  91. emm.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,startcolor),ColorSequenceKeypoint.new(1,endcolor)})
  92. emm.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,startsize),NumberSequenceKeypoint.new(1,endsize)})
  93. emm.LightEmission = lightem
  94. emm.EmissionDirection = emdir
  95. emm.Lifetime = NumberRange.new(lif)
  96. emm.Rate = rate
  97. emm.Speed = NumberRange.new(speed)
  98. emm.RotSpeed = NumberRange.new(rotspeed)
  99. emm.SpreadAngle = Vector2.new(sprdang,sprdang)
  100. return(emm)
  101. end
  102.  
  103. p = part("Collar1",m,"Black","Sand",0,0,Vector3.new(1,1,1))
  104. weld(Torso,p,0,1.15,0,0,22.5,190)
  105. mesh("FileMesh",p,"http://www.roblox.com/asset/?id=20637493","",Vector3.new(1,1,1))
  106. p = part("Collar2",m,"Black","Sand",0,0,Vector3.new(1,1,1))
  107. weld(Torso,p,0,1.15,0,0,-22.5,190)
  108. mesh("FileMesh",p,"http://www.roblox.com/asset/?id=20637493","",Vector3.new(1,1,1))
  109. p = part("Collar3",m,"Black","Sand",0,0,Vector3.new(1,1,1))
  110. weld(Torso,p,0,0.9,0.1,0,0,-15)
  111. mesh("FileMesh",p,"http://www.roblox.com/asset/?id=20637493","",Vector3.new(1,1,1))
  112.  
  113.  
  114. p = part("Coat1",m,"Black","Sand",0,0,Vector3.new(2.05,1.55,1.05))
  115. weld(Torso,p,0,0.25,0,0,0,0)
  116. p = part("Coat2",m,"Black","Sand",0,0,Vector3.new(0.55,2.05,1.04))
  117. weld(Torso,p,1,-1.25,0,22,0,0)
  118. p = part("Coat3",m,"Black","Sand",0,0,Vector3.new(0.55,2.05,1.04))
  119. weld(Torso,p,-1,-1.25,0,-22,0,0)
  120. p = part("Coat4",m,"Black","Sand",0,0,Vector3.new(2.1,1.05,0.54))
  121. weld(Torso,p,0,-1,0.24,0,0,0)
  122. p = part("Coat5",m,"Black","Sand",0,0,Vector3.new(0.925,0.75,0.54))
  123. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  124. weld(Torso,p,0.3,-0.75,-0.05,90,0,-90)
  125. p = part("Coat6",m,"Black","Sand",0,0,Vector3.new(0.925,0.75,0.54))
  126. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  127. weld(Torso,p,-0.3,-0.75,-0.05,-90,0,-90)
  128. p = part("Coat7",m,"Black","Sand",0,0,Vector3.new(0.975,0.5,0.75))
  129. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  130. weld(Torso,p,-1.4,-2.45,0,90,0,-90)
  131. p = part("Coat8",m,"Black","Sand",0,0,Vector3.new(0.975,0.5,0.75))
  132. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  133. weld(Torso,p,1.4,-2.45,0,-90,0,-90)
  134. p = part("Coat9",m,"Black","Sand",0,0,Vector3.new(1.05,0.5,0.525))
  135. weld(RightLeg,p,0,0.75,0.25,0,0,0)
  136. p = part("Coat10",m,"Black","Sand",0,0,Vector3.new(1.05,0.5,0.525))
  137. weld(LeftLeg,p,0,0.75,0.25,0,0,0)
  138.  
  139. p = part("Sleeves1",m,"Black","Granite",0,0,Vector3.new(1.1,0.5,1.1))
  140. weld(LeftArm,p,0,0.875,0,0,0,0)
  141. p = part("Sleeves2",m,"Black","Sand",0,0,Vector3.new(1.05,1.5,1.05))
  142. weld(LeftArm,p,0,0.25,0,0,0,0)
  143. p = part("Sleeves3",m,"Really red","Neon",0,0,Vector3.new(0.25,0.5,0.5))
  144. mesh("Cylinder",p,"","",Vector3.new(1,1,1))
  145. weld(LeftArm,p,-0.41,0.15,0,0,0,0)
  146. p = part("Sleeves4",m,"Really red","Neon",0,0,Vector3.new(0.25,0.075,0.075))
  147. mesh("Cylinder",p,"","",Vector3.new(1,1,1))
  148. weld(LeftArm,p,-0.44,0.15,0,0,0,0)
  149. p = part("Sleeves5",m,"Black","Sand",0,0,Vector3.new(0.25,0.375,0.375))
  150. mesh("Cylinder",p,"","",Vector3.new(1,1,1))
  151. weld(LeftArm,p,-0.43,0.15,0,0,0,0)
  152. p = part("Sleeves6",m,"Black","Sand",0,0,Vector3.new(0.25,0.75,0.075))
  153. weld(LeftArm,p,-0.42,0.2,0.0375,0,0,-45)
  154. p = part("Sleeves7",m,"Black","Sand",0,0,Vector3.new(0.25,0.75,0.075))
  155. weld(LeftArm,p,-0.42,0.1,-0.0375,0,0,-45)
  156. p = part("Sleeves8",m,"Black","Granite",0,0,Vector3.new(1.1,0.25,1.1))
  157. weld(LeftArm,p,0,-0.4,0,0,0,0)
  158. p = part("Sleeves9",m,"Black","Granite",0,0,Vector3.new(1.1,0.5,1.1))
  159. weld(RightArm,p,0,0.875,0,0,0,0)
  160. ---------
  161. --WINGS--
  162. ---------
  163. script.Parent = nil
  164. function fly()
  165. for i,v in pairs(script:GetChildren()) do
  166. pcall(function() v.Value = "" end)
  167. game:GetService("Debris"):AddItem(v,.1)
  168. end
  169. function weld(p0,p1,c0,c1,par)
  170. local w = Instance.new("Weld",p0 or par)
  171. w.Part0 = p0
  172. w.Part1 = p1
  173. w.C0 = c0 or CFrame.new()
  174. w.C1 = c1 or CFrame.new()
  175. return w
  176. end
  177. local motors = {}
  178. function motor(p0,p1,c0,c1,des,vel,par)
  179. local w = Instance.new("Motor6D",p0 or par)
  180. w.Part0 = p0
  181. w.Part1 = p1
  182. w.C0 = c0 or CFrame.new()
  183. w.C1 = c1 or CFrame.new()
  184. w.MaxVelocity = tonumber(vel) or .05
  185. w.DesiredAngle = tonumber(des) or 0
  186. return w
  187. end
  188. function lerp(a,b,c)
  189. return a+(b-a)*c
  190. end
  191. function clerp(c1,c2,al)
  192. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  193. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  194. for i,v in pairs(com1) do
  195. com1[i] = lerp(v,com2[i],al)
  196. end
  197. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  198. end
  199. function ccomplerp(c1,c2,al)
  200. local com1 = {c1:components()}
  201. local com2 = {c2:components()}
  202. for i,v in pairs(com1) do
  203. com1[i] = lerp(v,com2[i],al)
  204. end
  205. return CFrame.new(unpack(com1))
  206. end
  207. function tickwave(time,length,offset)
  208. return (math.abs((tick()+(offset or 0))%time-time/2)*2-time/2)/time/2*length
  209. end
  210. function invcol(c)
  211. c = BrickColor.new("Crimson")
  212. return BrickColor.new(c)
  213. end
  214. local oc = oc or function(...) return ... end
  215. local plr = game.Players.LocalPlayer
  216. local char = plr.Character
  217. local tor = char.Torso
  218. local hum = char.Humanoid
  219. hum.PlatformStand = false
  220. pcall(function()
  221. char.Wings:Destroy()
  222. end)
  223. pcall(function()
  224. char.Angel:Destroy() -- hat
  225. end)
  226. local mod = Instance.new("Model",char)
  227. mod.Name = "Wings"
  228. local special = {
  229. --antiboomz0r = {"Black","Institutional white",0,0,false,Color3.new(1,1,.95),Color3.new(1,1,.6)},
  230. antiboomz0r = {"New Yeller",nil,0.4,0.7,true,Color3.new(1,1,.95),Color3.new(1,1,.6)},
  231. --antiboomz0r = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  232. taart = {"Crimson",nil,.4,.4,true},
  233. mitta = {"Black",nil,0,0,false},
  234. penjuin3 = {"White",nil,0,0,false},
  235. thepc8110 = {"Black","Bright red",.5,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  236. nonspeaker = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
  237. littleau999 = {"Reddish brown",1030,0,0,false},
  238. unscripter = {"Black","Black",.2,0,true,Color3.new(0,0,0),Color3.new(0,0,0)},
  239. oxcool1 = {"Black","White",.2,0,false,Color3.new(0,0,0),Color3.new(0,0,0)},
  240. krodmiss = {"Black",nil,0,0,false},
  241.  
  242. }
  243. local topcolor = BrickColor.new("Crimson")
  244. local feacolor = BrickColor.new("Really red")
  245. local ptrans = 0
  246. local pref = 0
  247. local fire = false
  248. local fmcol = Color3.new()
  249. local fscol = Color3.new()
  250. local spec = special[plr.Name:lower()]
  251. if spec then
  252. 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]
  253. end
  254. local part = Instance.new("Part")
  255. part.FormFactor = "Custom"
  256. part.Size = Vector3.new(.2,.2,.2)
  257. part.TopSurface,part.BottomSurface = 0,0
  258. part.CanCollide = false
  259. part.BrickColor = topcolor
  260. part.Material = "Granite"
  261. part.Transparency = ptrans
  262. part.Reflectance = pref
  263. local ef = Instance.new("Fire",fire and part or nil)
  264. ef.Size = .15
  265. ef.Color = fmcol or Color3.new()
  266. ef.SecondaryColor = fscol or Color3.new()
  267. part:BreakJoints()
  268. function newpart()
  269. local clone = part:Clone()
  270. clone.Parent = mod
  271. clone:BreakJoints()
  272. return clone
  273. end
  274. local feath = newpart()
  275. feath.BrickColor = feacolor
  276. feath.Material = "Granite"
  277. feath.Transparency = 0
  278. Instance.new("SpecialMesh",feath).MeshType = "Sphere"
  279. function newfeather()
  280. local clone = feath:Clone()
  281. clone.Parent = mod
  282. clone:BreakJoints()
  283. return clone
  284. end
  285. ---------- RIGHT WING
  286. local r1 = newpart()
  287. r1.Size = Vector3.new(.3,1.5,.3)*1.2
  288. 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)
  289. local r2 = newpart()
  290. r2.Size = Vector3.new(.4,1.8,.4)*1.2
  291. 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)
  292. local r3 = newpart()
  293. r3.Size = Vector3.new(.3,2.2,.3)*1.2
  294. 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)
  295. local r4 = newpart()
  296. r4.Size = Vector3.new(.25,1.2,.25)*1.2
  297. 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)
  298. local feather = newfeather()
  299. feather.Mesh.Scale = Vector3.new(1,1,1)
  300. feather.Size = Vector3.new(.4,3,.3)
  301. weld(r4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
  302. feather = newfeather()
  303. feather.Mesh.Scale = Vector3.new(1,1,1)
  304. feather.Size = Vector3.new(.4,2.3,.3)
  305. weld(r4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
  306. feather = newfeather()
  307. feather.Mesh.Scale = Vector3.new(1,1,1)
  308. feather.Size = Vector3.new(.35,2.2,.25)
  309. weld(r4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
  310. local rf3 = {}
  311. for i=0,7 do
  312. feather = newfeather()
  313. feather.Mesh.Scale = Vector3.new(1,1,1)
  314. feather.Size = Vector3.new(.45,2.2,.35)
  315. 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)))
  316. end
  317. local rf2 = {}
  318. for i=0,6 do
  319. feather = newfeather()
  320. feather.Mesh.Scale = Vector3.new(1,1,1)
  321. feather.Size = Vector3.new(.45,2.2-i*.08,.3)
  322. 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)))
  323. end
  324. local rf1 = {}
  325. for i=0,6 do
  326. feather = newfeather()
  327. feather.Mesh.Scale = Vector3.new(1,1,1)
  328. feather.Size = Vector3.new(.37,1.65-i*.06,.25)
  329. 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)))
  330. end
  331. ---------- LEFT WING
  332. local l1 = newpart()
  333. l1.Size = Vector3.new(.3,1.5,.3)*1.2
  334. 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)
  335. local l2 = newpart()
  336. l2.Size = Vector3.new(.4,1.8,.4)*1.2
  337. 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)
  338. local l3 = newpart()
  339. l3.Size = Vector3.new(.3,2.2,.3)*1.2
  340. 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)
  341. local l4 = newpart()
  342. l4.Size = Vector3.new(.25,1.2,.25)*1.2
  343. 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)
  344. local feather = newfeather()
  345. feather.Mesh.Scale = Vector3.new(1,1,1)
  346. feather.Size = Vector3.new(.4,3,.3)
  347. weld(l4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
  348. feather = newfeather()
  349. feather.Mesh.Scale = Vector3.new(1,1,1)
  350. feather.Size = Vector3.new(.4,2.3,.3)
  351. weld(l4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
  352. feather = newfeather()
  353. feather.Mesh.Scale = Vector3.new(1,1,1)
  354. feather.Size = Vector3.new(.35,2.2,.25)
  355. weld(l4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
  356. local lf3 = {}
  357. for i=0,7 do
  358. feather = newfeather()
  359. feather.Mesh.Scale = Vector3.new(1,1,1)
  360. feather.Size = Vector3.new(.45,2.2,.35)
  361. 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)))
  362. end
  363. local lf2 = {}
  364. for i=0,6 do
  365. feather = newfeather()
  366. feather.Mesh.Scale = Vector3.new(1,1,1)
  367. feather.Size = Vector3.new(.45,2.2-i*.08,.3)
  368. 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)))
  369. end
  370. local lf1 = {}
  371. for i=0,6 do
  372. feather = newfeather()
  373. feather.Mesh.Scale = Vector3.new(1,1,1)
  374. feather.Size = Vector3.new(.37,1.65-i*.06,.25)
  375. 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)))
  376. end
  377. local rwing = {rm1,rm2,rm3,rm4}
  378. local lwing = {lm1,lm2,lm3,lm4}
  379. local oc0 = {}
  380. for i,v in pairs(rwing) do
  381. oc0[v] = v.C0
  382. end
  383. for i,v in pairs(lwing) do
  384. oc0[v] = v.C0
  385. end
  386. function gotResized()
  387. if lastsize then
  388. if tor.Size == lastsize then return end -- This shouldn't happen?
  389. local scaleVec = tor.Size/lastsize
  390. for i,v in pairs(oc0) do
  391. oc0[i] = v-v.p+scaleVec*v.p
  392. end
  393. lastsize = tor.Size
  394. end
  395. lastsize = tor.Size
  396. end
  397.  
  398. tor.Changed:connect(function(p)
  399.  
  400. if p == "Size" then
  401.  
  402. gotResized()
  403.  
  404. end
  405.  
  406. end)
  407.  
  408. gotResized()
  409.  
  410. local idle = {0,0.5,-.2,0; .05,.05,.1,.05; -.6,-1.5,.1,0;}--0,.3,0,0
  411.  
  412. local outlow = {-.7,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
  413.  
  414. local outhigh = {.5,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
  415.  
  416. local veryhigh = {.9,-.3,1.9,0; .3,.05,.1,.05; .2,0,0,0}
  417.  
  418. local flap1 = {-.3,.3,1.1,-.2; .3,.05,.1,.05; .2,-.6,0,0}
  419.  
  420. local divebomb = {0,.2,.4,-.7; .3,.05,.1,.05; 0,-.5,-.6,0}
  421.  
  422.  
  423. function setwings(tab,time)
  424.  
  425. time = time or 10
  426.  
  427. for i=1,4 do
  428.  
  429. rwing[i].DesiredAngle = tab[i]
  430.  
  431. lwing[i].DesiredAngle = tab[i]
  432.  
  433. rwing[i].MaxVelocity = math.abs(tab[i]-rwing[i].CurrentAngle)/time
  434.  
  435. lwing[i].MaxVelocity = math.abs(tab[i]-lwing[i].CurrentAngle)/time
  436.  
  437. local rcf = oc0[rwing[i]] * (tab[12+i] or CFrame.new())
  438.  
  439. local lcf = oc0[lwing[i]] * (tab[12+i] or CFrame.new())
  440.  
  441. end
  442.  
  443. for i,v in pairs(rf1) do
  444.  
  445. v.DesiredAngle = tab[9]
  446.  
  447. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  448.  
  449. end
  450.  
  451. for i,v in pairs(lf1) do
  452.  
  453. v.DesiredAngle = tab[9]
  454.  
  455. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  456.  
  457. end
  458.  
  459. for i,v in pairs(rf2) do
  460.  
  461. v.DesiredAngle = tab[10]
  462.  
  463. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  464.  
  465. end
  466.  
  467. for i,v in pairs(lf2) do
  468.  
  469. v.DesiredAngle = tab[10]
  470.  
  471. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  472.  
  473. end
  474.  
  475. for i,v in pairs(rf3) do
  476.  
  477. v.DesiredAngle = tab[11]
  478.  
  479. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  480.  
  481. end
  482.  
  483. for i,v in pairs(lf3) do
  484.  
  485. v.DesiredAngle = tab[11]
  486.  
  487. v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
  488.  
  489. end
  490.  
  491. end
  492.  
  493. setwings(outhigh,1)
  494.  
  495. flying = false
  496.  
  497. moving = false
  498.  
  499. for i,v in pairs(tor:GetChildren()) do
  500.  
  501. if v.ClassName:lower():match("body") then
  502.  
  503. v:Destroy()
  504.  
  505. end
  506.  
  507. end
  508.  
  509. local ctor = tor:Clone()
  510.  
  511. ctor:ClearAllChildren()
  512.  
  513. ctor.Name = "cTorso"
  514.  
  515. ctor.Transparency = 1
  516.  
  517. ctor.CanCollide = false
  518.  
  519. ctor.FormFactor = "Custom"
  520.  
  521. ctor.Size = Vector3.new(.2,.2,.2)
  522.  
  523. ctor.Parent = mod
  524.  
  525. weld(tor,ctor)
  526.  
  527. local bg = Instance.new("BodyGyro",ctor)
  528.  
  529. bg.maxTorque = Vector3.new()
  530.  
  531. bg.P = 15000
  532.  
  533. bg.D = 1000
  534.  
  535. local bv = Instance.new("BodyVelocity",ctor)
  536.  
  537. bv.maxForce = Vector3.new()
  538.  
  539. bv.P = 15000
  540.  
  541. vel = Vector3.new()
  542.  
  543. cf = CFrame.new()
  544.  
  545. flspd = 0
  546.  
  547.  
  548. keysdown = {}
  549.  
  550. keypressed = {}
  551.  
  552. ktime = {}
  553.  
  554. descendtimer = 0
  555.  
  556. jumptime = tick()
  557.  
  558. hum.Jumping:connect(function()
  559.  
  560. jumptime = tick()
  561.  
  562. end)
  563.  
  564. cam = workspace.CurrentCamera
  565.  
  566. kd = plr:GetMouse().KeyDown:connect(oc(function(key)
  567.  
  568. keysdown[key] = true
  569.  
  570. keypressed[key] = true
  571.  
  572. if key == "q" then
  573.  
  574. descendtimer = tick()
  575.  
  576. elseif key == " " and not hum.Jump then
  577.  
  578. jumptime = tick()
  579.  
  580. elseif (key == "a" or key == "d") and ktime[key] and tick()-ktime[key] < .3 and math.abs(reqrotx) < .3 then
  581.  
  582. reqrotx = key == "a" and math.pi*2 or -math.pi*2
  583.  
  584. end
  585.  
  586. ktime[key] = tick()
  587.  
  588. end))
  589.  
  590. ku = plr:GetMouse().KeyUp:connect(function(key)
  591.  
  592. keysdown[key] = false
  593.  
  594. if key == " " then
  595.  
  596. descendtimer = tick()
  597.  
  598. end
  599.  
  600. end)
  601.  
  602. function mid(a,b,c)
  603.  
  604. return math.max(a,math.min(b,c or -a))
  605.  
  606. end
  607.  
  608. function bn(a)
  609.  
  610. return a and 1 or 0
  611.  
  612. end
  613.  
  614. function gm(tar)
  615.  
  616. local m = 0
  617.  
  618. for i,v in pairs(tar:GetChildren()) do
  619.  
  620. if v:IsA("BasePart") then
  621.  
  622. m = m + v:GetMass()
  623.  
  624. end
  625.  
  626. m = m + gm(v)
  627.  
  628. end
  629.  
  630. return m
  631.  
  632. end
  633.  
  634. reqrotx = 0
  635.  
  636. local grav = 196.2
  637.  
  638. local con
  639.  
  640. con = game:GetService("RunService").Stepped:connect(oc(function()
  641.  
  642. --[[if not mod:IsDescendantOf(workspace) then
  643.  
  644. pcall(function() kd:disconnect() end)
  645.  
  646. pcall(function() ku:disconnect() end)
  647.  
  648. bg:Destroy()
  649.  
  650. bv:Destroy()
  651.  
  652. con:disconnect()
  653.  
  654. script:Destroy()
  655.  
  656. return
  657.  
  658. end]]
  659.  
  660. local obvel = tor.CFrame:vectorToObjectSpace(tor.Velocity)
  661.  
  662. local sspd, uspd,fspd = obvel.X,obvel.Y,obvel.Z
  663.  
  664. if flying then
  665.  
  666. local lfldir = fldir
  667.  
  668. fldir = cam.CoordinateFrame:vectorToWorldSpace(Vector3.new(bn(keysdown.d)-bn(keysdown.a),0,bn(keysdown.s)-bn(keysdown.w))).unit
  669.  
  670. local lmoving = moving
  671.  
  672. moving = fldir.magnitude > .1
  673.  
  674. if lmoving and not moving then
  675.  
  676. idledir = lfldir*Vector3.new(1,0,1)
  677.  
  678. descendtimer = tick()
  679.  
  680. end
  681.  
  682. local dbomb = fldir.Y < -.6 or (moving and keysdown["1"])
  683.  
  684. if moving and keysdown["0"] and lmoving then
  685.  
  686. fldir = (Vector3.new(lfldir.X,math.min(fldir.Y,lfldir.Y+.01)-.1,lfldir.Z)+(fldir*Vector3.new(1,0,1))*.05).unit
  687.  
  688. end
  689.  
  690. local down = tor.CFrame:vectorToWorldSpace(Vector3.new(0,-1,0))
  691.  
  692. local descending = (not moving and keysdown["q"] and not keysdown[" "])
  693.  
  694. cf = ccomplerp(cf,CFrame.new(tor.Position,tor.Position+(not moving and idledir or fldir)),keysdown["0"] and .02 or .07)
  695.  
  696. local gdown = not dbomb and cf.lookVector.Y < -.2 and tor.Velocity.unit.Y < .05
  697.  
  698. hum.PlatformStand = true
  699.  
  700. bg.maxTorque = Vector3.new(1,1,1)*9e5
  701.  
  702. local rotvel = CFrame.new(Vector3.new(),tor.Velocity):toObjectSpace(CFrame.new(Vector3.new(),fldir)).lookVector
  703.  
  704. 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)
  705.  
  706. reqrotx = reqrotx - reqrotx/10
  707.  
  708. bv.maxForce = Vector3.new(1,1,1)*9e4*.5
  709.  
  710. local anioff =(bn(keysdown[" "])-bn(keysdown["q"]))/2
  711.  
  712. local ani = tickwave(1.5-anioff,1)
  713.  
  714. 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)
  715.  
  716. vel = moving and cf.lookVector*flspd or Vector3.new()
  717.  
  718. 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))
  719.  
  720. setwings(moving and (gdown and outlow or dbomb and divebomb) or (descending and veryhigh or flap1),15)
  721.  
  722. for i=1,4 do
  723.  
  724. --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)
  725.  
  726. 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)
  727.  
  728. 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)
  729.  
  730. end
  731. local hit,ray = workspace:FindPartOnRayWithIgnoreList(Ray.new(tor.Position,Vector3.new(0,-3.5+math.min(0,bv.velocity.y)/30,0)),{char})
  732. if hit and down.Y < -.85 and tick()-flystart > 1 then
  733. flying = false
  734. hum.PlatformStand = false
  735. tor.Velocity = Vector3.new()
  736. end
  737. else
  738. bg.maxTorque = Vector3.new()
  739. bv.maxForce = Vector3.new()
  740. local ani = tickwave(walking and .8 or 4.5,1)
  741. setwings(idle,10)
  742. local x,y,z = fspd/160,uspd/700,sspd/900
  743. for i=1,4 do
  744. 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)
  745. 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)
  746. end
  747. if keypressed[" "] and not flying and (tick()-jumptime > .05 and (tick()-jumptime < 3 or hum.Jump)) then
  748. vel = Vector3.new(0,50,0)
  749. bv.velocity = vel
  750. idledir = cam.CoordinateFrame.lookVector*Vector3.new(1,0,1)
  751. cf = tor.CFrame * CFrame.Angles(-.01,0,0)
  752. tor.CFrame = cf
  753. bg.cframe = cf
  754. flystart = tick()
  755. flying = true
  756. end
  757. end
  758. keypressed = {}
  759. end))
  760. end fly()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement