TheCodeFinder45

Fly Script - ROBLOX Script

Oct 20th, 2013
35,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.35 KB | None | 0 0
  1. --Script made by thecodefinder45
  2.  
  3. --Go to line 3 and 5 and put your name where it says "YOUR NAME HERE"
  4.  
  5. Evil={'YOUR NAME HERE'}
  6. if not (script.Parent:IsA('HopperBin')) then
  7. bin=Instance.new('HopperBin',game.Players.YOUR NAME HERE.Backpack)
  8. bin.TextureId='http://www.roblox.com/asset/?id=54353092'
  9. bin.Name='AlaFly'
  10. script.Parent=bin
  11. else
  12. bin=script.Parent
  13. end
  14. player=bin.Parent.Parent
  15. debris=game:service('Debris')
  16. new=Instance.new
  17. fnew=CFrame.new
  18. brick=BrickColor.new
  19. vnew=Vector3.new
  20. rot=CFrame.fromEulerAnglesXYZ
  21. if script.className~='LocalScript'then
  22. bin:remove()
  23. end
  24. T=new('Sound')
  25. T.SoundId='rbxassetid://2101157'
  26. T.Pitch=.4
  27. motors={
  28. right={},
  29. left={},
  30. mains={}
  31. }
  32. X=function(f)coroutine.resume(coroutine.create(f))end
  33. life=function(obj,time)debris:AddItem(obj,time)end
  34. local bv,bg,torso,Lmotor,Rmotor,head
  35. fly=250
  36. findt=function()
  37. for i,v in pairs(player.Character:children())do
  38. if v.Name=='Torso'then
  39. return v
  40. end
  41. end
  42. end
  43. wing=function()
  44. torso=player.Character.Torso
  45. for i,v in pairs(torso.Parent:children())do
  46. if v.Name=='WingMain'then
  47. v:remove()
  48. end
  49. end
  50. mainwingpart=new('WedgePart')
  51. mainwingpart.Name='WingMain'
  52. mainwingpart.CanCollide=false
  53. mainwingpart.Size=vnew(1,1,1)
  54. mainwingpart.Transparency=1
  55. mainwingpart.BrickColor=BrickColor.White()
  56. mainwingpart.Parent=player.Character
  57. weld=new('Weld',torso)
  58. weld.Part0=weld.Parent
  59. weld.Part1=mainwingpart
  60. weld.C0=fnew(0,.4,0)
  61. WingRight=new('WedgePart')
  62. WingRight.formFactor=3
  63. WingRight.Size=vnew(.04,.3,.5)
  64. WingRight.CanCollide=false
  65. WingRight.BrickColor=BrickColor.White()
  66. WingRight.Parent=mainwingpart
  67. Rmotor=new('Motor',mainwingpart)
  68. Rmotor.Part0=Rmotor.Parent
  69. Rmotor.Part1=WingRight
  70. Rmotor.C1=rot(0,math.pi/1.5,0)+vnew(-.18,-.10,.8)
  71. nextpp=nil
  72. dan=-2
  73. for w=1,15 do
  74. wait()
  75. dan=dan+1
  76. pp=new('WedgePart')
  77. pp.Locked=true
  78. pp.BrickColor=BrickColor.White()
  79. pp.formFactor=3
  80. if w==1 then
  81. pp.Size=vnew(.3,2.5,.8)
  82. else
  83. pp.Size=vnew(.3,1/(w/5),2/w)
  84. end
  85. pp.CanCollide=false
  86. pp.BrickColor=BrickColor.White()
  87. pp.CFrame=WingRight.CFrame
  88. pp.Material='Slate'
  89. pp.Parent=WingRight
  90. if dan==1 then
  91. dan=0
  92. asdlal=new('WedgePart')
  93. asdlal.BrickColor=BrickColor.White()
  94. asdlal.formFactor=3
  95. asdlal.Size=vnew(.25,pp.Size.y,15/w)
  96. for lawlz,Evil in pairs(Evil)do
  97. if player.Name==Evil then
  98. asdlal:remove()
  99. asdlal=new('WedgePart')
  100. asdlal.formFactor=3
  101. asdlal.BrickColor=BrickColor.White()
  102. asdlal.Size=vnew(.25,.8,15/w)
  103. end
  104. end
  105. asdlal.Locked=true
  106. asdlal.CanCollide=false
  107. asdlal.Material='Slate'
  108. asdlal.Parent=pp
  109. mmm=new('Motor',pp)
  110. mmm.Part0=pp
  111. mmm.Part1=asdlal
  112. mmm.C0=fnew(0,0,-asdlal.Size.z/2)
  113. end
  114. if w==1 then
  115. ppmotor=new('Motor',WingRight)
  116. else
  117. ppmotor=new('Motor',nextpp)
  118. end
  119. table.insert(motors.right,ppmotor)
  120. ppmotor.Part0=ppmotor.Parent
  121. ppmotor.Part1=pp
  122. if w==1 then
  123. ppmotor.C0=rot(-.04,-math.pi/6,0)+vnew(.3,0,-.1)
  124. else
  125. ppmotor.C0=rot(-.1/(w/7),-.07,0)+vnew(0,pp.Size.y,0)
  126. end
  127. nextpp=pp
  128. end
  129. WingLeft=new('WedgePart')
  130. WingLeft.formFactor=3
  131. WingLeft.Size=vnew(.04,.3,.5)
  132. WingLeft.CanCollide=false
  133. WingLeft.BrickColor=BrickColor.White()
  134. WingLeft.Parent=mainwingpart
  135. Lmotor=new('Motor',mainwingpart)
  136. Lmotor.Part0=Lmotor.Parent
  137. Lmotor.Part1=WingLeft
  138. Lmotor.C1=rot(0,-math.pi/1.5,0)+vnew(0.18,-.10,.8)
  139. nextpp=nil
  140. dan=-2
  141. for w=1,15 do
  142. wait()
  143. dan=dan+1
  144. pp=new('WedgePart')
  145. pp.Locked=true
  146. pp.BrickColor=BrickColor.White()
  147. pp.formFactor=3
  148. if w==1 then
  149. pp.Size=vnew(.3,2.5,.8)
  150. else
  151. pp.Size=vnew(.3,1/(w/5),2/w)
  152. end
  153. pp.CanCollide=false
  154. pp.BrickColor=BrickColor.White()
  155. pp.CFrame=WingLeft.CFrame
  156. pp.Material='Slate'
  157. pp.Parent=WingLeft
  158. if dan==1 then
  159. dan=0
  160. asdlal=new('WedgePart')
  161. asdlal.BrickColor=BrickColor.White()
  162. asdlal.formFactor=3
  163. asdlal.Size=vnew(.25,pp.Size.y,15/w)
  164. for lawlz,Evil in pairs(Evil)do
  165. if player.Name==Evil then
  166. asdlal:remove()
  167. asdlal=new('WedgePart')
  168. asdlal.formFactor=3
  169. asdlal.BrickColor=BrickColor.White()
  170. asdlal.Size=vnew(.25,.8,15/w)
  171. end
  172. end
  173. asdlal.Locked=true
  174. asdlal.CanCollide=false
  175. asdlal.Material='Slate'
  176. asdlal.Parent=pp
  177. mmm=new('Motor',pp)
  178. mmm.Part0=pp
  179. mmm.Part1=asdlal
  180. mmm.C0=fnew(0,0,-asdlal.Size.z/2)
  181. end
  182. if w==1 then
  183. ppmotor=new('Motor',WingLeft)
  184. else
  185. ppmotor=new('Motor',nextpp)
  186. end
  187. ppmotor.Part0=ppmotor.Parent
  188. table.insert(motors.left,ppmotor)
  189. ppmotor.Part1=pp
  190. if w==1 then
  191. ppmotor.C0=rot(-.04,math.pi/6,0)+vnew(-.3,0,-.1)
  192. else
  193. ppmotor.C0=rot(-.1/(w/7),.07,0)+vnew(0,pp.Size.y,0)
  194. end
  195. nextpp=pp
  196. end
  197. X(function()
  198. for i,v in pairs(motors.right)do
  199. v.C1=rot(.1,0,0)
  200. wait()
  201. end
  202. for i,v in pairs(motors.right)do
  203. v.C1=rot(0,-.1,-.1)
  204. wait()
  205. end
  206. end)
  207. X(function()
  208. for i,v in pairs(motors.left)do
  209. v.C1=rot(.1,0,0)
  210. wait()
  211. end
  212. for i,v in pairs(motors.left)do
  213. v.C1=rot(0,.1,.1)
  214. wait()
  215. end
  216. end)
  217. X(function()
  218. for i,v in pairs(motors.right)do
  219. v.C1=rot(.1,0,0)
  220. wait()
  221. end
  222. for i,v in pairs(motors.right)do
  223. v.C1=rot(0,-.1,0)
  224. wait()
  225. end
  226. end)
  227. X(function()
  228. for i,v in pairs(motors.left)do
  229. v.C1=rot(.1,0,0)
  230. wait()
  231. end
  232. for i,v in pairs(motors.left)do
  233. v.C1=rot(0,.1,0)
  234. wait()
  235. end
  236. end)
  237. Rmotor.MaxVelocity=.1
  238. Lmotor.MaxVelocity=.1
  239. Lmotor.DesiredAngle=.8
  240. Rmotor.DesiredAngle=-.8
  241. end
  242. leftarm=function(bool)
  243. X(function()
  244. newlarm=new('Motor6D')
  245. newlarm.Name='Left Shoulder'
  246. newlarm.Parent=player.Character.Torso
  247. newlarm.Part0=player.Character.Torso
  248. newlarm.Part1=player.Character['Left Arm']
  249. wait()--hmm
  250. newlarm.C0=fnew(-1,.5,0,0,0,-1,0,1,0,1,0,0)
  251. newlarm.C1=fnew(.5,.5,0,0,0,-1,0,1,0,1,0,0)
  252. if bool==false then return newlarm end
  253. an=player.Character.Animate
  254. an.Disabled=true
  255. an.Disabled=false
  256. end)
  257. return newlarm
  258. end
  259. Name=function()
  260. name=''
  261. for LA=1,3 do
  262. name=name..string.char(math.random(0,255))
  263. end
  264. return name
  265. end
  266. Lazer=function(m)wllwlw=false
  267. for i,v in pairs(Evil)do
  268. if v==player.Name then
  269. wllwlw=true break
  270. end
  271. end
  272. if wllwlw==false then return end
  273. if asdTroll~=nil then return end
  274. asdTroll='asd'
  275. rarm=rightarm(false)
  276. rarm.MaxVelocity=.2
  277. rarm.DesiredAngle=math.rad(110)
  278. larm=leftarm(false)
  279. larm.MaxVelocity=.2
  280. larm.DesiredAngle=-math.rad(110)
  281. lball=new('Part')
  282. life(lball,10)
  283. lball.Shape=0
  284. lball.Size=vnew(1,1,1)
  285. lball.CanCollide=false
  286. lball.BottomSurface=0
  287. lball.TopSurface=0
  288. lball.Transparency=.5
  289. lball.BrickColor=BrickColor.White()
  290. for i,v in pairs(Evil)do
  291. if player.Name==v then
  292. lball.BrickColor=BrickColor.White()
  293. end
  294. end
  295. lball.Parent=player.Character
  296. lweld=new('Weld',larm.Part1)
  297. lweld.Part0=lweld.Parent
  298. lweld.Part1=lball
  299. lweld.C0=fnew(0,-4,0)
  300. rball=new('Part')
  301. life(rball,10)
  302. rball.Shape=0
  303. rball.Size=vnew(1,1,1)
  304. rball.Transparency=.5
  305. rball.CanCollide=false
  306. rball.BottomSurface=0
  307. rball.TopSurface=0
  308. rball.BrickColor=BrickColor.White()
  309. for i,v in pairs(Evil)do
  310. if player.Name==v then
  311. rball.BrickColor=BrickColor.White()
  312. end
  313. end
  314. rball.Parent=player.Character
  315. rweld=new('Weld',rarm.Part1)
  316. rweld.Part0=rweld.Parent
  317. rweld.Part1=rball
  318. rweld.C0=fnew(0,-4,0)
  319. X(function()
  320. X(function()
  321. for KG=1,157 do wait()
  322. part=new('Part')
  323. life(part,.2)
  324. part.Transparency=.3
  325. asdrandom=(math.random(5,20)/10)+KG/40
  326. new('BlockMesh',part).Scale=vnew(asdrandom,asdrandom,asdrandom)
  327. part.Size=vnew(1,1,1)
  328. part.Anchored=true
  329. part.CFrame=rot(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))+lball.Position
  330. part.Name='asd'
  331. part.BrickColor=BrickColor.White()
  332. for i,v in pairs(Evil)do
  333. if player.Name==v then
  334. part.BrickColor=BrickColor.White()
  335. end
  336. end
  337. part.Parent=lball
  338. end
  339. end)
  340. for KG2=1,157 do wait()
  341. part=new('Part')
  342. life(part,.2)
  343. part.Transparency=.3
  344. asdrandom=(math.random(5,20)/10)+KG2/40
  345. new('BlockMesh',part).Scale=vnew(asdrandom,asdrandom,asdrandom)
  346. part.Size=vnew(1,1,1)
  347. part.Anchored=true
  348. part.CFrame=rot(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))+rball.Position
  349. part.Name='asd'
  350. part.BrickColor=BrickColor.White()
  351. for i,v in pairs(Evil)do
  352. if player.Name==v then
  353. part.BrickColor=BrickColor.White()
  354. end
  355. end
  356. part.Parent=rball
  357. end
  358. rball:remove()
  359. lball:remove()
  360. rightarm(true)
  361. leftarm(true)
  362. asdTroll=nil
  363. for wasd=1,200 do
  364. if pp~=nil then pp:remove()end
  365. if asdTroll~=nil then return end
  366. pos=m.Hit.p
  367. pp=new('WedgePart')
  368. life(pp,.1)
  369. pp.formFactor=3
  370. pp.BrickColor=BrickColor.White()
  371. pp.Transparency=.2
  372. pp.Size=vnew(6,1000,6)
  373. pp.CFrame=CFrame.new(pos.x,pos.y+(pp.Size.y/2),pos.z)+vnew(math.random(-3,3),0,math.random(-3,3))
  374. exp=Instance.new('Explosion')
  375. exp.Position=pos+vnew(math.random(-3,3),0,math.random(-3,3))
  376. exp.BlastRadius=30
  377. exp.Parent=workspace
  378. Join=new('Part')
  379. Join.formFactor=0
  380. Join.Size=vnew(1,1,1)
  381. new('SpecialMesh',Join).Mesh'Sphere'
  382. Join.Mesh.Scale=vnew(60,60,60)
  383. Join.Anchored=true
  384. Join.BottomSurface=0
  385. Join.TopSurface=0
  386. Join.BrickColor=BrickColor.White()
  387. Join.Transparency=.5
  388. Join.CFrame=rot(0,math.rad(3.6*wasd)*2,0)+pos+vnew(math.random(-3,3),0,math.random(-3,3))
  389. Join.Parent=pp
  390. pJoin=new('Part')
  391. life(pJoin,.4)
  392. new('BlockMesh',pJoin).Scale=vnew(10,10,10)+vnew((wasd/30),(wasd/30),(wasd/30))
  393. pJoin.formFactor=0
  394. pJoin.Size=vnew(1,1,1)
  395. pJoin.Anchored=true
  396. pJoin.BrickColor=BrickColor.White()
  397. pJoin.Transparency=.5
  398. pJoin.CFrame=rot(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))+pos+vnew(math.random(-3,3),0,math.random(-3,3))
  399. pJoin.Parent=workspace
  400. pp.Parent=player.Character
  401. wait()
  402. pp.BrickColor=BrickColor.White()
  403. end
  404. end)
  405. -- rightarm(true)
  406. end
  407. rightarm=function(bool)
  408. if pcall(function()
  409. newrarm=new('Motor6D')
  410. newrarm.Name='Right Shoulder'
  411. newrarm.Parent=player.Character.Torso
  412. newrarm.Part0=player.Character.Torso
  413. newrarm.Part1=player.Character['Right Arm']
  414. newrarm.C0=fnew(1,.5,0,0,0,1,0,1,0,-1,0,0)
  415. newrarm.C1=fnew(-.5,.5,0,0,0,1,0,1,0,-1,0,0)
  416. if bool==false then return newlarm end
  417. pcall(function()
  418. an=player.Character.Animate
  419. an.Disabled=true
  420. an.Disabled=false
  421. end)
  422. end)then
  423. return newrarm
  424. end
  425. end
  426. light=function()
  427. if pcall(function()torso=player.Character.Torso end)then
  428. else
  429. return
  430. end
  431. larm=leftarm(false)
  432. tt=T:clone()
  433. life(tt,0)
  434. tt.Parent=workspace
  435. tt:play()
  436. Pl=new('WedgePart')
  437. life(Pl,20)
  438. Pl.CFrame=torso.CFrame+torso.CFrame.lookVector*6
  439. Pl.Anchored=true
  440. Pl.CanCollide=false
  441. Pl.Parent=workspace
  442. leftarm(true)
  443. end
  444. bodys=function(asd)
  445. for i,v in pairs(torso:children())do
  446. if v:IsA('BodyVelocity')or v:IsA('BodyGyro')then
  447. v:remove()
  448. end
  449. end
  450. if asd==true then return end
  451. bv=new('BodyVelocity')
  452. bg=new('BodyGyro')
  453. bv.maxForce=vnew(math.huge,math.huge,math.huge)
  454. bv.velocity=vnew(0,0,0)
  455. bg.maxTorque=vnew(0,0,0)
  456. bg.Parent=torso
  457. bv.Parent=torso
  458. end
  459. ball=function(asd)
  460. for i,v in pairs(player.Character:children())do
  461. if v.Name=='Fly Ball'then
  462. v:remove()
  463. end
  464. end
  465. if asd==true then return end
  466. part=new('Part')
  467. part.Shape=0
  468. part.BottomSurface=0
  469. part.TopSurface=0
  470. part.Size=torso.Size*5
  471. part.Transparency=.5
  472. part.BrickColor=BrickColor.White()
  473. part.CanCollide=false
  474. part.CFrame=torso.CFrame
  475. part.Name='Fly Ball'
  476. part.Parent=player.Character
  477. weld=new('Weld')
  478. weld.Parent=torso
  479. weld.Part0=weld.Parent
  480. weld.Part1=part
  481. part.Touched:connect(function()
  482. for i=1,5 do
  483. wait()
  484. part.Transparency=.5-i/10
  485. end
  486. part.Transparency=.5
  487. end)
  488. end
  489. script.Parent.Selected:connect(function(m)
  490. torso=player.Character.Torso
  491. bodys(true)
  492. m.KeyDown:connect(function(k)
  493. if k=='q'then
  494. fly=fly-10
  495. if fly<0 then
  496. fly=10
  497. end
  498. elseif k=='r'then
  499. wing()
  500. elseif k=='f'then
  501. Lazer(m)
  502. elseif k=='t'then
  503. X(function()player.Character.WingMain:remove()end)
  504. elseif k=='e'then
  505. fly=fly+10
  506. elseif k=='y'then
  507. MUp=false
  508. bodys(false)
  509. elseif k=='p'then
  510. print'asd'
  511. elseif k=='b'then
  512. fly=150
  513. elseif k=='x'then
  514. X(function()
  515. if m.Target==workspace or m.Target==nil then return end
  516. ko=new('ObjectValue')
  517. game:service('Debris'):AddItem(ko,1)
  518. ko.Value=player
  519. ko.Name='creator'
  520. for i,v in pairs(m.Target.Parent:children())do
  521. if v:IsA('Humanoid')then
  522. ko.Parent=v
  523. v.Torso:BreakJoints()
  524. X(function()
  525. for asd=1,100 do
  526. wait()
  527. part=new('WedgePart')
  528. game:service('Debris'):AddItem(part,.2)
  529. part.formFactor=0
  530. part.Transparency=.3
  531. part.Anchored=true
  532. part.CanCollide=false
  533. part.CFrame=rot(math.rad(math.random(1,180)),math.rad(math.random(1,180)),math.rad(math.random(1,180)))+v.Torso.Position
  534. part.Size=vnew(2,2,2)
  535. part.BrickColor=BrickColor.White()
  536. random=math.random(part.Size.x,part.Size.x*2)
  537. new('BlockMesh',part).Scale=vnew(random,random,random)
  538. part.Parent=workspace
  539. end
  540. end)
  541. end
  542. end
  543. end)
  544. end
  545. end)
  546. m.Button1Down:connect(function()
  547. ball(true)
  548. bodys(false)
  549. MUp=false
  550. rightarm(false)
  551. leftarm(false)
  552. bg.maxTorque=Vector3.new(900000,900000,900000)
  553. bg.cframe=fnew(torso.Position,m.hit.p)*rot(math.rad(-60),0,0)
  554. bv.velocity=fnew(torso.Position,m.hit.p).lookVector*fly
  555. end)
  556. m.Move:connect(function()
  557. if MUp==true then return end
  558. torso=player.Character.Torso
  559. X(function()
  560. bg.maxTorque=vnew(math.huge,math.huge,math.huge)
  561. bg.cframe=fnew(torso.Position,m.hit.p)*rot(math.rad(-60),0,0)
  562. bv.velocity=fnew(torso.Position,m.hit.p).lookVector*fly
  563. end)
  564. end)
  565. m.Button1Up:connect(function()
  566. MUp=true
  567. ball(true)
  568. bodys(false)
  569. rightarm(true)
  570. leftarm(true)
  571. bv.maxForce=vnew(10000,10000,10000)
  572. delay(2,function()if MUp==true then bodys(true)end end)
  573. torso.Velocity=vnew(0,0,0)
  574. torso.RotVelocity=vnew(0,0,0)
  575. torso.CFrame=fnew(torso.Position,m.hit.p)*rot(0,0,0)
  576. torso.Velocity=vnew(0,0,0)
  577. torso.RotVelocity=vnew(0,0,0)
  578. end)
  579. end)
  580. bin.Deselected:connect(function()
  581. X(function()
  582. ball(true)
  583. bodys(true)
  584. torso.Velocity=vnew(0,0,0)
  585. torso.RotVelocity=vnew(0,0,0)
  586. end)
  587. end)
  588. function onTouched(part)
  589. local h = part.Parent:findFirstChild("Humanoid")
  590. if h~=nil then
  591. h.Health = 0
  592. end
  593. end
  594. script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment