Advertisement
Guest User

mario script ROBLOX

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