Advertisement
KHSora455

Jarred's Hovercraft

Feb 21st, 2015
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.87 KB | None | 0 0
  1. --jarredbcv's hovercraft made in 30 min
  2. lp=game.Players.LocalPlayer
  3. pl=lp.Character
  4. rotsped=124
  5. psped=20
  6. speed=0
  7. turn=0
  8. rot=0
  9. heat=0
  10. function w()
  11. if pl.Humanoid.Sit==false then return end
  12. bre=true
  13. move:play()
  14. idle:stop()
  15. rotsped=20
  16. psped=1
  17. speed=80
  18. end
  19. function a()
  20. lop=false
  21. if pl.Humanoid.Sit==false then return end
  22. coroutine.wrap(function()
  23. while wait() do
  24. if lop==true then break end
  25. turn=turn+3
  26. end end)()
  27. for i=1,5 do wait()
  28. rweld1.C1 = rweld1.C1*CFrame.Angles(0,-i/20,0)
  29. rweld1.C1 = rweld1.C1+Vector3.new(.03,0,0)
  30. rweld2.C1 = rweld2.C1*CFrame.Angles(0,-i/20,0)
  31. rweld2.C1 = rweld2.C1+Vector3.new(.03,0,0)
  32. end
  33. end
  34. function d()
  35. if pl.Humanoid.Sit==false then return end
  36. lop=false
  37. coroutine.wrap(function()
  38. while wait() do
  39. if lop==true then break end
  40. turn=turn-3
  41. end end)()
  42. for i=1,5 do wait()
  43. rweld1.C1 = rweld1.C1*CFrame.Angles(0,i/20,0)
  44. rweld1.C1 = rweld1.C1+Vector3.new(.03,0,0)
  45. rweld2.C1 = rweld2.C1*CFrame.Angles(0,i/20,0)
  46. rweld2.C1 = rweld2.C1+Vector3.new(.03,0,0)
  47. end
  48. end
  49. function uw()
  50. if pl.Humanoid.Sit==false then return end
  51. bre=false
  52. rotsped=124
  53. psped=20
  54. for i=1,80 do wait()
  55. if bre==true then break end
  56. speed=speed-1
  57. end
  58. move:stop()
  59. idle:play()
  60. end
  61. function ua()
  62. lop=true
  63. if pl.Humanoid.Sit==false then return end
  64. for i=1,5 do wait()
  65. rweld1.C1 = rweld1.C1*CFrame.Angles(0,i/20,0)
  66. rweld1.C1 = rweld1.C1-Vector3.new(.03,0,0)
  67. rweld2.C1 = rweld2.C1*CFrame.Angles(0,i/20,0)
  68. rweld2.C1 = rweld2.C1-Vector3.new(.03,0,0)
  69. end
  70. end
  71. function ud()
  72. if pl.Humanoid.Sit==false then return end
  73. lop=true
  74. for i=1,5 do wait()
  75. rweld1.C1 = rweld1.C1*CFrame.Angles(0,-i/20,0)
  76. rweld1.C1 = rweld1.C1-Vector3.new(.03,0,0)
  77. rweld2.C1 = rweld2.C1*CFrame.Angles(0,-i/20,0)
  78. rweld2.C1 = rweld2.C1-Vector3.new(.03,0,0)
  79. end
  80. end
  81. function fix()
  82. print'Returned'
  83. if pl.Humanoid.Sit==false then se.Disabled=true se.Disabled=false end
  84. rotsped=124
  85. psped=20
  86. speed=0
  87. turn=0
  88. rweld1.C1 = CFrame.new(-5.2,2.5,1)
  89. rweld2.C1 = CFrame.new(-5.2,2.5,-1)
  90. MAIN.CFrame=CFrame.new(-20,2,-40)
  91. end
  92. function f()
  93. sb=false
  94. if pl.Humanoid.Sit==false then return end
  95. row:play()
  96. for i=1,10 do wait(.1) rot=rot+1*i end
  97. while wait(.1) do if sb==true then break end
  98. if heat>=1 then break end
  99. shot:play()
  100. heat=heat+.01
  101. x= Part(.1,.1,1.5,'Bright yellow',0,true,false,workspace,0,0,0) x:BreakJoints()
  102. y = Instance.new("BodyVelocity")
  103. y.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  104. y.velocity = ya.CFrame.lookVector *200
  105. y.Parent = x
  106. x.CFrame = ya.CFrame * CFrame.new(math.random(-.75,.75),math.random(-.75,.75),-1)
  107. function touch(hit)
  108. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  109. hit.Parent.Humanoid:TakeDamage(math.random(3,7))
  110. end end x.Touched:connect(touch)
  111. game.Debris:AddItem(x,1)
  112. end
  113. end
  114. function uf()
  115. if pl.Humanoid.Sit==false then return end
  116. sb=true
  117. for i=1,10 do wait(.1) rot=rot+1-i end
  118. if heat>=.01 then for i=1,100 do wait()
  119. heat=heat-0.01
  120. end end
  121. row:stop()
  122. rot=0
  123. end
  124. Part = function(x,y,z,color,tr,cc,an,parent,xx,yy,zz)
  125. local p = Instance.new('Part',parent or Weapon)
  126. p.formFactor = 'Custom'
  127. p.Size = Vector3.new(x,y,z)
  128. p.BrickColor = BrickColor.new(color)
  129. p.CanCollide = cc
  130. p.Transparency = tr
  131. p.Anchored = an
  132. p.TopSurface,p.BottomSurface = 0,0
  133. p.CFrame=CFrame.new(xx,yy,zz)
  134. return p end
  135. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  136. p0.Position = p1.Position
  137. local w = Instance.new('Motor',par or p0)
  138. w.Part0 = p0
  139. w.Part1 = p1
  140. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  141. return w end
  142. Mesh = function(par,num,x,y,z)
  143. local msh = _
  144. if num == 1 then msh = Instance.new("CylinderMesh",par)
  145. elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3
  146. elseif num == 3 then msh = Instance.new("BlockMesh",par)
  147. elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par) msh.MeshId = num
  148. end msh.Scale = Vector3.new(x,y,z)return msh end
  149. Seat = function(x,y,z,color,tr,cc,an,parent,xx,yy,zz)
  150. local p = Instance.new('Seat',parent or Weapon)
  151. p.formFactor = 'Custom'
  152. p.Size = Vector3.new(x,y,z)
  153. p.BrickColor = BrickColor.new(color)
  154. p.CanCollide = cc
  155. p.Transparency = tr
  156. p.Anchored = an
  157. p.TopSurface,p.BottomSurface = 0,0
  158. p.CFrame=CFrame.new(xx,yy,zz)
  159. return p end
  160. mouse = lp:GetMouse()
  161. function onKeyDown(key)
  162. key = key:lower()
  163. if key == "w" then w()end
  164. if key == "a" then a()end
  165. if key == "d" then d()end
  166. if key == "r" then fix()end
  167. if key == "f" then f()end
  168. end function onKeyUp(key)
  169. key = key:lower()
  170. if key == "w" then uw()end
  171. if key == "a" then ua()end
  172. if key == "d" then ud()end
  173. if key == "f" then uf()end
  174. end
  175. --isaMachine
  176. mo=Instance.new("Model",pl)
  177. MAIN= Part(10,.5,5,'',0,true,false,mo,-20,2,-40)
  178. for i=1,6 do
  179. pa= Part(1,1,1,'Really red',0,true,false,mo,0,0,0)
  180. weld= Weld(pa,MAIN,7-i*2,-.75,-2.5,0,0,0,mo)
  181. m=Mesh(pa,2,3,2,2)
  182. end for i=1,6 do
  183. pa= Part(1,1,1,'Really red',0,true,false,mo,0,0,0)
  184. weld= Weld(pa,MAIN,7-i*2,-.75,2.5,0,0,0,mo)
  185. m=Mesh(pa,2,3,2,2)
  186. end for i=1,2 do
  187. pa= Part(1,1,1,'Really black',0,true,false,mo,0,0,0)
  188. weld= Weld(pa,MAIN,5.75,-.75,3-i*2,0,0,0,mo)
  189. m=Mesh(pa,2,2,2,3)end
  190. pa= Part(1,5,.1,'Really red',0,true,false,mo,0,0,0)
  191. weld= Weld(pa,MAIN,-4,2.5,2,0,0,0,mo)
  192. pa= Part(1,5,.1,'Really red',0,true,false,mo,0,0,0)
  193. weld= Weld(pa,MAIN,-4,2.5,-2,0,0,0,mo)
  194. pa= Part(1,.1,4,'Really black',0,true,false,mo,0,0,0)
  195. weld= Weld(pa,MAIN,-4,4.9,0,0,0,0,mo)
  196. pa= Part(.1,5,.5,'Really red',0,true,false,mo,0,0,0)
  197. weld= Weld(pa,MAIN,-3.6,2.5,-1,0,0,0,mo)
  198. pa= Part(.1,5,.5,'Really black',0,true,false,mo,0,0,0)
  199. weld= Weld(pa,MAIN,-3.6,2.5,0,0,0,0,mo)
  200. pa= Part(.1,5,.5,'Really red',0,true,false,mo,0,0,0)
  201. weld= Weld(pa,MAIN,-3.6,2.5,1,0,0,0,mo)
  202. pa= Part(.1,2.5,.5,'',0,true,false,mo,0,0,0)
  203. weld= Weld(pa,MAIN,-4.4,1.25,0,0,0,0,mo)
  204. pa= Part(1,1,1,'',0,true,false,mo,0,0,0)
  205. weld= Weld(pa,MAIN,-4.3,2.5,0,0,0,math.pi/2,mo)
  206. m=Mesh(pa,1,.5,.5,.5)
  207. spn= Part(1,1,1,'Really black',0,true,false,mo,0,0,0)
  208. spweld= Weld(spn,MAIN,-4.2,2.5,0,0,0,math.pi/2,mo)
  209. m=Mesh(spn,1,.51,.1,.51)
  210. pa= Part(1,1,1,'Institutional white',0,true,false,mo,0,0,0)
  211. weld= Weld(pa,spn,1,0,0,0,0,math.pi/2,mo)
  212. m=Mesh(pa,2,.1,1.8,.5)
  213. pa= Part(1,1,1,'Institutional white',0,true,false,mo,0,0,0)
  214. weld= Weld(pa,spn,-.9,0,0,0,0,math.pi/2,mo)
  215. m=Mesh(pa,2,.1,1.8,.5)
  216. pa= Part(.1,.1,4.2,'Really red',0,true,false,mo,0,0,0)
  217. weld= Weld(pa,MAIN,-4.6,1.25,0,0,0,0,mo)
  218. pa= Part(.1,.1,4.2,'Really red',0,true,false,mo,0,0,0)
  219. weld= Weld(pa,MAIN,-4.6,4,0,0,0,0,mo)
  220. rotr1= Part(1,3.5,.1,'Really black',0,true,false,mo,0,0,0)
  221. rweld1= Weld(rotr1,MAIN,-5.2,2.5,1,0,0,0,mo)
  222. rotr2= Part(1,3.5,.1,'Really black',0,true,false,mo,0,0,0)
  223. rweld2= Weld(rotr2,MAIN,-5.2,2.5,-1,0,0,0,mo)
  224. se= Seat(2,.1,1,'Really red',0,true,false,mo,0,0,0)
  225. weld= Weld(se,MAIN,0,.35,0,0,-math.pi/2,0,mo)
  226. pa= Part(2.25,2,1,'Really red',0,true,false,mo,0,0,0)
  227. weld= Weld(pa,MAIN,.5,.75,1.5,0,0,0,mo)
  228. pa= Part(2.25,2,1,'Really red',0,true,false,mo,0,0,0)
  229. weld= Weld(pa,MAIN,.5,.75,-1.5,0,0,0,mo)
  230. pa= Part(2,.1,3,'Really black',0,true,false,mo,0,0,0)
  231. weld= Weld(pa,MAIN,1,.25,0,0,-math.pi/2,0,mo)
  232. pa= Part(1,3,4,'Really black',0,true,false,mo,0,0,0)
  233. weld= Weld(pa,MAIN,-1,1.75,0,0,0,0,mo)
  234. pa= Part(1,1,1,'Really red',0,true,false,mo,0,0,0)
  235. weld= Weld(pa,MAIN,4,1,0,0,0,0,mo)
  236. m=Mesh(pa,1,.3,2,.3)
  237. pa= Part(1,1,1,'Really black',0,true,false,mo,0,0,0)
  238. weld= Weld(pa,MAIN,3.5,1,.75,-math.pi/5,0,-math.pi/8,mo)
  239. m=Mesh(pa,1,.3,2.5,.3)
  240. pa= Part(1,1,1,'Really black',0,true,false,mo,0,0,0)
  241. weld= Weld(pa,MAIN,3.5,1,-.75,math.pi/5,0,-math.pi/8,mo)
  242. m=Mesh(pa,1,.3,2.5,.3)
  243. tur= Part(.75,.75,.75,'Really red',0,true,false,mo,0,0,0)
  244. turweld= Weld(tur,MAIN,4,1.75,0,0,0,0,mo)
  245. spin= Part(1,1,1,'',0,true,false,mo,0,0,0)
  246. spinweld= Weld(spin,tur,.4,0,0,0,0,math.pi/2,mo)
  247. m=Mesh(spin,1,.75,.1,.75)
  248. pa1= Part(1,1,1,'',0,true,false,mo,0,0,0)
  249. weld= Weld(pa1,spin,.25,-.8,0,0,0,0,mo)
  250. m=Mesh(pa1,1,.2,1.5,.2)
  251. pa2= Part(1,1,1,'',0,true,false,mo,0,0,0)
  252. weld= Weld(pa2,spin,-.25,-.8,0,0,0,0,mo)
  253. m=Mesh(pa2,1,.2,1.5,.2)
  254. pa3= Part(1,1,1,'',0,true,false,mo,0,0,0)
  255. weld= Weld(pa3,spin,0,-.8,.25,0,0,0,mo)
  256. m=Mesh(pa3,1,.2,1.5,.2)
  257. pa4= Part(1,1,1,'',0,true,false,mo,0,0,0)
  258. weld= Weld(pa4,spin,0,-.8,-.25,0,0,0,mo)
  259. m=Mesh(pa4,1,.2,1.5,.2)
  260. pa= Part(1,1,1,'',0,true,false,mo,0,0,0)
  261. weld= Weld(pa,spin,0,-.6,0,0,0,0,mo)
  262. m=Mesh(pa,1,.75,.1,.75)
  263. pa= Part(1,1,1,'',0,true,false,mo,0,0,0)
  264. weld= Weld(pa,spin,0,-1.25,0,0,0,0,mo)
  265. m=Mesh(pa,1,.75,.1,.75)
  266. ya= Part(1,1,1,'Really black',1,true,false,mo,0,0,0)
  267. weld= Weld(ya,MAIN,6,1.75,0,0,-math.pi/2,0,mo)
  268. bv=Instance.new("BodyVelocity",MAIN)
  269. bv.maxForce=Vector3.new(1e1000,1e1000,1e1000)
  270. bv.velocity=Vector3.new(0,0,0)
  271. flo=Instance.new("BodyVelocity",MAIN)
  272. flo.maxForce=Vector3.new(1e1000,1e1000,1e1000)
  273. flo.velocity=Vector3.new(0,-100,0)
  274. bg=Instance.new("BodyGyro",MAIN)
  275. bg.maxTorque=Vector3.new(0,400000,0)
  276. idle = Instance.new("Sound",MAIN)idle.SoundId = "http://www.roblox.com/asset/?id=146767821"idle.Looped=true
  277. move = Instance.new("Sound",MAIN)move.SoundId = "http://www.roblox.com/asset/?id=142317661"move.Looped=true
  278. shot = Instance.new("Sound",MAIN)shot.SoundId = "http://www.roblox.com/asset/?id=2692806"shot.Pitch=.8
  279. hot = Instance.new("Sound",MAIN)hot.SoundId = "http://roblox.com/asset/?id=10209881"hot.Pitch=1.7
  280. row = Instance.new("Sound",MAIN)row.SoundId = "http://www.roblox.com/asset/?id=2766581"row.Pitch=0.6 row.Looped=true
  281. coroutine.wrap(function()
  282. while wait() do
  283. for i=1,rotsped do wait()
  284. spweld.C1 = CFrame.new(-4.2,2.5,0)*CFrame.Angles(i/psped,0,math.pi/2)
  285. end end end)()
  286. coroutine.wrap(function()
  287. while wait() do
  288. bv.velocity = pl.Torso.CFrame.lookVector * speed
  289. bg.cframe = CFrame.Angles(math.rad(0),math.rad(turn),math.rad(0))
  290. spinweld.C1 = spinweld.C1*CFrame.Angles(0,math.rad(rot),0)
  291. pa1.BrickColor=BrickColor.new(Color3.new(heat,0,0))
  292. pa2.BrickColor=BrickColor.new(Color3.new(heat,0,0))
  293. pa3.BrickColor=BrickColor.new(Color3.new(heat,0,0))
  294. pa4.BrickColor=BrickColor.new(Color3.new(heat,0,0))
  295. if heat>=1 then hot:play() end
  296. row.Pitch = .6 + (.3 * (rot/40))
  297. end end)()idle:play()
  298. mouse.KeyDown:connect(onKeyDown)
  299. mouse.KeyUp:connect(onKeyUp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement