Hebablazin

Glider

May 30th, 2016
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.16 KB | None | 0 0
  1. --[[Glider]]--
  2.  
  3. --- Made by DoogleFox, Full credit given
  4. local player = game:service("Players").LocalPlayer
  5. local char = player.Character
  6. local cam = workspace.CurrentCamera
  7. local Torsoz = char:findFirstChild("Torso")
  8. local RA = char:findFirstChild("Right Arm")
  9. local LA = char:findFirstChild("Left Arm")
  10. local RL = char:findFirstChild("Right Leg")
  11. local LL = char:findFirstChild("Left Leg")
  12. local H = char:findFirstChild("Head")
  13. local RS = Torsoz:findFirstChild("Right Shoulder")
  14. local LS = Torsoz:findFirstChild("Left Shoulder")
  15. local RH = Torsoz:findFirstChild("Right Hip")
  16. local LH = Torsoz:findFirstChild("Left Hip")
  17. local N = Torsoz:findFirstChild("Neck")
  18. local hu = char:findFirstChild("Humanoid")
  19. local mouse = player:GetMouse()
  20. local Lights = {}
  21. local JetFlames = {}
  22. local LightChangeSpeed = 0.02
  23. local LeftWing
  24. local RightWing
  25. local WingParts = {}
  26. local Flying = false
  27. local JetActive = false
  28. local idle = false
  29. local velo = 0
  30.  
  31. local bp = Instance.new("BodyPosition")
  32. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  33. bp.D = 100
  34. local bg = Instance.new("BodyGyro")
  35. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  36. bg.D = 320
  37. local bv = Instance.new("BodyVelocity")
  38. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  39.  
  40. local P = Instance.new("Part")
  41. P.Anchored = false
  42. P.CanCollide = false
  43. P.Name = "Part"
  44. P.formFactor = "Custom"
  45. P.Size = Vector3.new(0.5,0.5,0.5)
  46. P.Locked = true
  47. P.TopSurface = 0
  48. P.BottomSurface = 0
  49. P.BrickColor = BrickColor.new("Dark stone grey")
  50. P.Transparency = 0
  51.  
  52. local bp = Instance.new("BodyPosition")
  53. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  54. local bv = Instance.new("BodyVelocity")
  55. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  56. local bg = Instance.new("BodyGyro")
  57. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  58. bg.D = 300
  59.  
  60. local wingcolor = "Really black"
  61. local maxvelo = 60
  62. local acceleration = 1
  63.  
  64. ---------------------------------- Design ------------------------------------------
  65. for i, v in pairs(char:children()) do
  66. if v.className == "Model" and v.Name == "Pack" then
  67. v:remove()
  68. end
  69. end
  70. local m = Instance.new("Model", char)
  71. m.Name = "Pack"
  72.  
  73. local b = P:Clone()
  74. b.Parent = m
  75. local mesh = Instance.new("SpecialMesh", b)
  76. mesh.MeshType = "Head"
  77. mesh.Scale = Vector3.new(2.6,1.2,2.6)
  78. local w = Instance.new("Motor", b)
  79. w.Part0 = Torsoz
  80. w.Part1 = b
  81. w.C0 = CFrame.new(0,0.2,0.35) * CFrame.Angles(math.pi/2,0,0)
  82. local p = P:Clone()
  83. p.Parent = m
  84. local mesh = Instance.new("SpecialMesh", p)
  85. mesh.MeshType = "Head"
  86. mesh.Scale = Vector3.new(2,1.2,2)
  87. local w = Instance.new("Motor", p)
  88. w.Part0 = Torsoz
  89. w.Part1 = p
  90. w.C0 = CFrame.new(0,0.2,0.45) * CFrame.Angles(math.pi/2,0,0)
  91.  
  92. local p = P:Clone()
  93. p.Parent = m
  94. local mesh = Instance.new("SpecialMesh", p)
  95. mesh.MeshType = "Head"
  96. mesh.Scale = Vector3.new(2.02,1.2,2.02)
  97. local w = Instance.new("Motor", p)
  98. w.Part0 = Torsoz
  99. w.Part1 = p
  100. w.C0 = CFrame.new(0,0.2,0.445) * CFrame.Angles(math.pi/2,0,0)
  101. table.insert(Lights, p)
  102.  
  103. for i = 1, 3 do
  104. local p = P:Clone()
  105. p.Parent = m
  106. local mesh = Instance.new("CylinderMesh", p)
  107. if i == 2 then
  108. mesh.Scale = Vector3.new(0.4,1.2,0.4)
  109. else
  110. mesh.Scale = Vector3.new(0.35,1,0.35)
  111. end
  112. local w = Instance.new("Motor", p)
  113. w.Part0 = Torsoz
  114. w.Part1 = p
  115. w.C0 = CFrame.new(-0.3+(0.15*i),-0.25,0.55)
  116. if i == 2 then
  117. CenterJet = p
  118. end
  119. local l = P:Clone()
  120. l.Parent = m
  121. local mesh = Instance.new("CylinderMesh", l)
  122. local w = Instance.new("Motor", l)
  123. w.Part0 = p
  124. w.Part1 = l
  125. if i == 2 then
  126. mesh.Scale = Vector3.new(0.405,0.12,0.405)
  127. w.C0 = CFrame.new(0,-0.2,0)
  128. else
  129. mesh.Scale = Vector3.new(0.355,0.12,0.355)
  130. w.C0 = CFrame.new(0,-0.15,0)
  131. end
  132. table.insert(Lights, l)
  133. end
  134.  
  135. for i = 1, 3 do
  136. local l = P:Clone()
  137. l.Parent = m
  138. local mesh = Instance.new("CylinderMesh", l)
  139. mesh.Scale = Vector3.new(0.12,0.1,0.12)
  140. local w = Instance.new("Motor", l)
  141. w.Part0 = Torsoz
  142. w.Part1 = l
  143. w.C0 = CFrame.new(0.3-(0.15*i),0.3,0.73) * CFrame.Angles(math.pi/2,0,0)
  144. table.insert(Lights, l)
  145. end
  146.  
  147. ------- wings ------
  148. for i = 0, 1 do
  149. local p = P:Clone()
  150. p.Parent = m
  151. local mesh = Instance.new("SpecialMesh", p)
  152. mesh.MeshType = "Sphere"
  153. mesh.Scale = Vector3.new(1,1,1)
  154. local w = Instance.new("Motor", p)
  155. w.Part0 = Torsoz
  156. w.Part1 = p
  157. w.C0 = CFrame.new(0,0.55,0.55) * CFrame.Angles(0,math.pi*i,0)
  158. w.C1 = CFrame.new(0.425,0,0)
  159.  
  160. local c = P:Clone()
  161. c.Parent = m
  162. c.BrickColor = BrickColor.new(wingcolor)
  163. c.Name = "WingSpine"..i+1
  164. local mesh = Instance.new("BlockMesh", c)
  165. mesh.Scale = Vector3.new(0.26,6,0.2)
  166. local w = Instance.new("Motor", c)
  167. w.Part0 = p
  168. w.Part1 = c
  169. w.C0 = CFrame.Angles(0,0,-math.pi/7)
  170. w.C1 = CFrame.new(0,1.5,0)
  171. w.MaxVelocity = 0.15
  172. if i == 0 then
  173. LeftWing = w
  174. else
  175. RightWing = w
  176. end
  177. table.insert(WingParts, c)
  178. local p = P:Clone()
  179. p.Parent = m
  180. p.BrickColor = BrickColor.new(wingcolor)
  181. local mesh = Instance.new("SpecialMesh", p)
  182. mesh.MeshType = "Wedge"
  183. mesh.Scale = Vector3.new(0.2,4,2.2)
  184. local w = Instance.new("Motor", p)
  185. w.Part0 = c
  186. w.Part1 = p
  187. w.C0 = CFrame.new(0.485,-0.85,0) * CFrame.Angles(math.pi,-math.pi/2,0)
  188. table.insert(WingParts, p)
  189. local p = P:Clone()
  190. p.Parent = m
  191. p.BrickColor = BrickColor.new(wingcolor)
  192. local mesh = Instance.new("BlockMesh", p)
  193. mesh.Scale = Vector3.new(2,0.5,0.2)
  194. local w = Instance.new("Motor", p)
  195. w.Part0 = c
  196. w.Part1 = p
  197. w.C0 = CFrame.new(0.535,0.275,0)
  198. table.insert(WingParts, p)
  199. local p = P:Clone()
  200. p.Parent = m
  201. p.BrickColor = BrickColor.new(wingcolor)
  202. local mesh = Instance.new("SpecialMesh", p)
  203. mesh.MeshType = "Wedge"
  204. mesh.Scale = Vector3.new(0.2,1.5,1)
  205. local w = Instance.new("Motor", p)
  206. w.Part0 = c
  207. w.Part1 = p
  208. w.C0 = CFrame.new(0.785,0.77,0) * CFrame.Angles(0,-math.pi/2,0)
  209. table.insert(WingParts, p)
  210. local p = P:Clone()
  211. p.Parent = m
  212. p.BrickColor = BrickColor.new(wingcolor)
  213. local mesh = Instance.new("BlockMesh", p)
  214. mesh.Scale = Vector3.new(0.94,1.5,0.2)
  215. local w = Instance.new("Motor", p)
  216. w.Part0 = c
  217. w.Part1 = p
  218. w.C0 = CFrame.new(0.3,0.77,0)
  219. table.insert(WingParts, p)
  220. local p = P:Clone()
  221. p.Parent = m
  222. p.BrickColor = BrickColor.new(wingcolor)
  223. local mesh = Instance.new("SpecialMesh", p)
  224. mesh.MeshType = "Wedge"
  225. mesh.Scale = Vector3.new(0.2,1,0.977)
  226. local w = Instance.new("Motor", p)
  227. w.Part0 = c
  228. w.Part1 = p
  229. w.C0 = CFrame.new(0.3,1.385,0) * CFrame.Angles(0,-math.pi/2,0)
  230. table.insert(WingParts, p)
  231.  
  232. end
  233.  
  234. local spacedet = 0
  235. local KEYS = {false, false, false, false}
  236. mouse.KeyDown:connect(function(key)
  237. if key == string.char(32) then
  238. if (tick() - spacedet) < 0.3 then
  239. Flying = not Flying
  240. end
  241. spacedet = tick()
  242. end
  243. if key == "w" then
  244. KEYS[1] = true
  245. end
  246. if key == "a" then
  247. KEYS[2] = true
  248. end
  249. if key == "s" then
  250. KEYS[3] = true
  251. end
  252. if key == "d" then
  253. KEYS[4] = true
  254. end
  255. end)
  256.  
  257. mouse.KeyUp:connect(function(key)
  258. if key == "w" then
  259. KEYS[1] = false
  260. end
  261. if key == "a" then
  262. KEYS[2] = false
  263. end
  264. if key == "s" then
  265. KEYS[3] = false
  266. end
  267. if key == "d" then
  268. KEYS[4] = false
  269. end
  270. end)
  271.  
  272. local LTrailParts = {}
  273. for i = 1, 21 do
  274. local p = P:Clone()
  275. p.Name = "TrailLine"
  276. p.Anchored = true
  277. p.BrickColor = BrickColor.new(wingcolor)
  278. local mesh = Instance.new("CylinderMesh", p)
  279. mesh.Name = "Mesh"
  280. table.insert(LTrailParts, p)
  281. end
  282. local RTrailParts = {}
  283. for i = 1, 21 do
  284. local p = P:Clone()
  285. p.Name = "TrailLine"
  286. p.Anchored = true
  287. p.BrickColor = BrickColor.new(wingcolor)
  288. local mesh = Instance.new("CylinderMesh", p)
  289. mesh.Name = "Mesh"
  290. table.insert(RTrailParts, p)
  291. end
  292. local Loldpos
  293. local Roldpos
  294.  
  295. local lightval = {0.1, true}
  296. local refval = 0.1
  297. local firecolors = {"Bright red", "Bright orange"}
  298. local firespeed = 2
  299. local trailnum = 0
  300. local num = 0
  301. local lastflyaction = false
  302. local lastidleaction = false
  303. local idlebp = {0, 0, Torsoz.Position, true}
  304.  
  305. while true do
  306. num = num + 1
  307. trailnum = trailnum + 1
  308.  
  309. local unitz = (Torsoz.Position - cam.CoordinateFrame.p).unit
  310. local camsight = Torsoz.Position + (unitz*90)
  311. local diff = camsight.y - Torsoz.Position.y
  312.  
  313. ---------------------- Velocity Changes ----------------------------
  314.  
  315. ----------- W key --------------
  316. if KEYS[1] == true then
  317. velo = velo + acceleration
  318. else
  319. if velo > 0 then
  320. local UP = velo - (acceleration/1.5)
  321. if velo > 0 and UP < 0 then
  322. velo = velo + UP
  323. end
  324. velo = velo - (acceleration/1.5)
  325. end
  326. end
  327. ------------ S key -------------
  328. if KEYS[3] == true then
  329. if velo > 0 then
  330. velo = velo - acceleration*1.2
  331. else
  332. velo = velo - (acceleration/1.5)
  333. end
  334. else
  335. if velo < 0 then
  336. local DOWN = velo + acceleration
  337. if velo < 0 and DOWN > 0 then
  338. velo = velo - DOWN
  339. end
  340. velo = velo + acceleration
  341. end
  342. end
  343.  
  344. local maxvelocalc = maxvelo
  345. if diff < -35 then
  346. if velo > 0 then
  347. maxvelocalc = maxvelo + (maxvelo * -(((diff+35)/110)))
  348. end
  349. elseif diff > 35 then
  350. if velo < 0 then
  351. maxvelocalc = maxvelo + (maxvelo * -((((-diff)+35)/110)))
  352. end
  353. end
  354.  
  355. if velo >= maxvelocalc then
  356. velo = maxvelocalc
  357. elseif velo <= -maxvelocalc/2 then
  358. velo = -maxvelocalc/2
  359. end
  360.  
  361. ------------------------- Lights ----------------------
  362. if lightval[1] < 0.15 then
  363. lightval[2] = true
  364. elseif lightval[1] > 0.76 then
  365. lightval[2] = false
  366. end
  367. if lightval[2] == true then
  368. lightval[1] = lightval[1] + LightChangeSpeed
  369. else
  370. lightval[1] = lightval[1] - LightChangeSpeed
  371. end
  372. for i, v in pairs(Lights) do
  373. v.Transparency = lightval[1]
  374. if LightChangeSpeed > 0.15 then
  375. v.BrickColor = BrickColor.new("Bright red")
  376. elseif LightChangeSpeed > 0.08 then
  377. v.BrickColor = BrickColor.new("Bright orange")
  378. else
  379. v.BrickColor = BrickColor.new("Bright green")
  380. end
  381. end
  382. --------------------------------------------------------
  383.  
  384. --------------------- Wing Shines -------------------------
  385. for i, v in pairs(WingParts) do
  386. if Flying == true then
  387. if v.Reflectance > 0.19 then
  388. v.Reflectance = v.Reflectance - 0.035
  389. else
  390. v.Reflectance = 0.19
  391. end
  392. else
  393. if v.Reflectance < 0.43 then
  394. v.Reflectance = v.Reflectance + 0.035
  395. else
  396. v.Reflectance = 0.43
  397. end
  398. end
  399. end
  400. ----------------------------------------------------
  401.  
  402. ------------------------ Jet Boost Flames --------------------------------
  403. if num%firespeed == 0 and JetActive == true then
  404. local f = P:Clone()
  405. f.Parent = m
  406. f.Name = "JetFire"
  407. f.BrickColor = BrickColor.new(firecolors[math.random(1, #firecolors)])
  408. f.Transparency = 0.15
  409. f.Anchored = true
  410. f.CFrame = CenterJet.CFrame * CFrame.new(0,-0.3,0)
  411. local mesh = Instance.new("BlockMesh", f)
  412. mesh.Scale = Vector3.new(0.6,0.6,0.6)
  413. table.insert(JetFlames, {mesh, (f.Position - CenterJet.Position).unit})
  414. end
  415.  
  416. for i, v in pairs(JetFlames) do
  417. if v[1].Parent.Transparency < 0.9 then
  418. v[1].Parent.Transparency = v[1].Parent.Transparency + 0.03
  419. v[1].Scale = v[1].Scale + Vector3.new(0.08,0.08,0.08)
  420. v[1].Parent.CFrame = v[1].Parent.CFrame * CFrame.Angles(math.random(-180,180)/360,math.random(-180,180)/360,math.random(-180,180)/360)
  421. if idle == false then
  422. v[1].Parent.CFrame = v[1].Parent.CFrame + (v[2]*0.1)
  423. else
  424. v[1].Parent.CFrame = v[1].Parent.CFrame + (v[2]*0.24)
  425. end
  426. else
  427. v[1].Parent:remove()
  428. table.remove(JetFlames, i)
  429. end
  430. end
  431. --------------------------------------------------
  432.  
  433. ------------------------------ Flying --------------------------------
  434.  
  435. if Flying == true then
  436.  
  437. if lastflyaction == false then
  438. bg = Instance.new("BodyGyro", Torsoz)
  439. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  440. bg.D = 350
  441. end
  442.  
  443.  
  444. --------- idle checker --------
  445. if (velo > -0.5 and velo < 0.5) and (KEYS[1] == false and KEYS[3] == false) then
  446. idle = true
  447. if lastidleaction == false then
  448. idlebp[3] = Torsoz.Position
  449. end
  450. else
  451. idle = false
  452. end
  453.  
  454. --------- idle float anim -----------
  455. if idle == true then
  456. if lastidleaction == false then
  457. idlebp = {0, 0, Torsoz.Position, true}
  458. end
  459. if idlebp[2] >= 0.3 then
  460. idlebp[4] = false
  461. elseif idlebp[2] <= -0.3 then
  462. idlebp[4] = true
  463. end
  464. if idlebp[4] == false then
  465. idlebp[2] = idlebp[2] - 0.02
  466. elseif idlebp[4] == true then
  467. idlebp[2] = idlebp[2] + 0.02
  468. end
  469. idlebp[1] = idlebp[1] + idlebp[2]
  470. end
  471.  
  472. ---------------- Body Objects ----------------------
  473.  
  474. if idle == true then
  475. if lastidleaction == false then
  476. bv:remove()
  477. bp:remove()
  478. bp = Instance.new("BodyPosition")
  479. end
  480. hu.PlatformStand = true
  481. bp.Parent = Torsoz
  482. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  483. bp.D = 100
  484. bp.position = idlebp[3] + Vector3.new(0,idlebp[1],0)
  485. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position + cam.CoordinateFrame.lookVector)
  486. else
  487. if lastidleaction == true then
  488. bp:remove()
  489. bv:remove()
  490. bv = Instance.new("BodyVelocity")
  491. end
  492. hu.PlatformStand = true
  493. bv.Parent = Torsoz
  494. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  495. local torpos = Torsoz.Position + (cam.CoordinateFrame.lookVector * 10)
  496. bv.velocity = CFrame.new(Torsoz.Position+Vector3.new(0,-2,0), torpos).lookVector*velo
  497. local cvelo = velo
  498. if velo > maxvelo then
  499. cvelo = maxvelo
  500. end
  501. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position + cam.CoordinateFrame.lookVector) * CFrame.Angles((-math.pi/2.3)*(cvelo/maxvelo),0,0)
  502.  
  503. end
  504.  
  505. elseif Flying == false then
  506. if lastflyaction == true then
  507. hu.PlatformStand = false
  508. bp.Parent = nil
  509. bg.Parent = nil
  510. bv.Parent = nil
  511. idle = false
  512. end
  513.  
  514. end --- if flying == true
  515.  
  516. -----------------------------------------
  517.  
  518. ----------------------- Auto Anims -----------------------
  519. if Flying == true then
  520. if diff > 40 then
  521. LeftWing.DesiredAngle = -0.3
  522. RightWing.DesiredAngle = -0.3
  523. LightChangeSpeed = 0.24
  524. JetActive = true
  525. ActiveTrails = true
  526. firespeed = 1
  527. elseif diff > -22 and diff < 40 then
  528. LeftWing.DesiredAngle = -math.pi/2.5
  529. RightWing.DesiredAngle = -math.pi/2.5
  530. LightChangeSpeed = 0.09
  531. JetActive = true
  532. ActiveTrails = true
  533. firespeed = 2
  534. elseif diff > -60 and diff < -22 then
  535. LeftWing.DesiredAngle = -math.pi/2.5
  536. RightWing.DesiredAngle = -math.pi/2.5
  537. LightChangeSpeed = 0.04
  538. JetActive = false
  539. ActiveTrails = true
  540. elseif diff < -60 then
  541. LeftWing.DesiredAngle = -0.1
  542. RightWing.DesiredAngle = -0.1
  543. LightChangeSpeed = 0.04
  544. JetActive = false
  545. ActiveTrails = true
  546. end
  547. if idle == true then
  548. LeftWing.DesiredAngle = -math.pi/2.2
  549. RightWing.DesiredAngle = -math.pi/2.2
  550. LightChangeSpeed = 0.09
  551. JetActive = true
  552. ActiveTrails = false
  553. firespeed = 1
  554. end
  555. if diff < -40 and velo < 0 then
  556. LeftWing.DesiredAngle = -0.3
  557. RightWing.DesiredAngle = -0.3
  558. LightChangeSpeed = 0.24
  559. JetActive = true
  560. ActiveTrails = true
  561. firespeed = 1
  562. elseif (diff < -22 and diff > -40) and velo < 0 then
  563. LeftWing.DesiredAngle = -math.pi/2.5
  564. RightWing.DesiredAngle = -math.pi/2.5
  565. LightChangeSpeed = 0.09
  566. JetActive = true
  567. ActiveTrails = true
  568. firespeed = 2
  569. end
  570. else
  571. LeftWing.DesiredAngle = 0
  572. RightWing.DesiredAngle = 0
  573. JetActive = false
  574. ActiveTrails = false
  575. LightChangeSpeed = 0.02
  576. end
  577. -----------------------------------------
  578.  
  579. ------------------------ Trail lines ------------------------------
  580. if num%2 == 0 then
  581.  
  582. if Flying == true and ActiveTrails == true then
  583. if velo > 0 then
  584. if velo < acceleration*7 then
  585. Loldpos = nil
  586. Roldpos = nil
  587. end
  588. elseif velo < 0 then
  589. if velo > -acceleration*7 then
  590. Loldpos = nil
  591. Roldpos = nil
  592. end
  593. end
  594.  
  595. if Loldpos ~= nil then
  596. local newpos = (LeftWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  597. local t = LTrailParts[trailnum]
  598. t.Parent = m
  599. t.Anchored = true
  600. t.BrickColor = BrickColor.new(wingcolor)
  601. t.CFrame = CFrame.new((Loldpos+newpos)/2,Loldpos) * CFrame.Angles(math.pi/2,0,0)
  602. local mesh = Instance.new("CylinderMesh", t)
  603. mesh.Name = "Mesh"
  604. mesh.Scale = Vector3.new(0.2,(Loldpos - newpos).magnitude*2,0.2)
  605. end
  606. if Roldpos ~= nil then
  607. local newpos = (RightWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  608. local t = RTrailParts[trailnum]
  609. t.Parent = m
  610. t.Anchored = true
  611. t.BrickColor = BrickColor.new(wingcolor)
  612. t.CFrame = CFrame.new((Roldpos+newpos)/2,Roldpos) * CFrame.Angles(math.pi/2,0,0)
  613. local mesh = Instance.new("CylinderMesh", t)
  614. mesh.Name = "Mesh"
  615. mesh.Scale = Vector3.new(0.2,(Roldpos - newpos).magnitude*2,0.2)
  616. end
  617. Loldpos = (LeftWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  618. Roldpos = (RightWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  619.  
  620. else
  621. LTrailParts[trailnum].Parent = nil
  622. RTrailParts[trailnum].Parent = nil
  623. Loldpos = (LeftWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  624. Roldpos = (RightWing.Parent.CFrame * CFrame.new(0,-1.7,0)).p
  625. end
  626.  
  627. end
  628.  
  629. if trailnum == #LTrailParts-1 then
  630. trailnum = 0
  631. end
  632.  
  633. if num%800 == 0 then
  634. for i, v in pairs(LTrailParts) do
  635. game:service("Debris"):AddItem(v, 0.7)
  636. end
  637. for i, v in pairs(RTrailParts) do
  638. game:service("Debris"):AddItem(v, 0.7)
  639. end
  640. LTrailParts = {}
  641. for i = 1, 21 do
  642. local p = P:Clone()
  643. p.Name = "LTrailLine"
  644. p.Anchored = true
  645. p.BrickColor = BrickColor.new(wingcolor)
  646. local mesh = Instance.new("CylinderMesh", p)
  647. mesh.Name = "Mesh"
  648. table.insert(LTrailParts, p)
  649. end
  650. RTrailParts = {}
  651. for i = 1, 21 do
  652. local p = P:Clone()
  653. p.Name = "RTrailLine"
  654. p.Anchored = true
  655. p.BrickColor = BrickColor.new(wingcolor)
  656. local mesh = Instance.new("CylinderMesh", p)
  657. mesh.Name = "Mesh"
  658. table.insert(RTrailParts, p)
  659. end
  660. end
  661.  
  662. ----------------------------------------------
  663.  
  664. lastflyaction = Flying
  665. lastidleaction = idle
  666. wait(0.03)
  667. end
Add Comment
Please, Sign In to add comment