Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.04 KB | None | 0 0
  1. --Mini Rocket Launcher Gifted by TheRedAngel, Local Script!
  2.  
  3. me = owner
  4. char = me.Character
  5. name = "MiniRocketLauncher"
  6. explodecolors = {"Really red", "Neon orange", "Bright red", "New Yeller", "Bright yellow", "Bright orange"}
  7. sm = {"Really black", "Black"}
  8. acceleratemax = 100
  9. accelerateincrease = 0.55
  10. MassDestruct = 100
  11. MaxEnergy = 160
  12. Energy = MaxEnergy
  13. EnergyCost = 0.3
  14. IncreaseEnergy = 10
  15. MaxSpeed = 120
  16. MinSpeed = MaxSpeed/4
  17. SpeedIncrease = 0.34
  18. Speed = MinSpeed
  19.  
  20. function GiveHp(mass)
  21. return (mass*(mass/9.6)/9.6) + 8
  22. end
  23.  
  24. function BrickDmg(d, part, pos)
  25. local dm = math.random(d/2.5,d/1.5)
  26. dm = (dm - (part.Position - pos.p).magnitude)
  27. if dm < 0 then dm = 0 end
  28. return dm
  29. end
  30.  
  31. function CheckEnergy()
  32. if Energy > MaxEnergy then
  33. Energy = MaxEnergy
  34. elseif Energy < 0 then Energy = 0 end
  35. end
  36.  
  37. hold = false
  38. jethold = false
  39. sel = false
  40. abletofire = true
  41. JetsOn = false
  42. Flying = false
  43. order = 1
  44. modes = {{"Normal", 6, 5400, 18, 32, 0.4, 7}, {"Accelerate", 7, 4200, 22, 5, 0.5, 9}, {"Machine gun", 4, 1400, 11, 65, 0.18, 3}, {"Blast", 11, 2000, 34, 23, 0.9, 13}}
  45. mode = modes[order]
  46. screenname = "MiniRocketGui"
  47. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  48.  
  49. swoosh = Instance.new("Sound")
  50. swoosh.Looped = true
  51. swoosh.Volume = 0.4
  52. swoosh.Pitch = 1.9
  53. swoosh.SoundId = "rbxasset://sounds\\Rocket whoosh 01.wav"
  54.  
  55. bewm = Instance.new("Sound")
  56. bewm.Looped = false
  57. bewm.Volume = 0.7
  58. bewm.Pitch = 1.5
  59. bewm.SoundId = "http://www.roblox.com/asset/?id=2101148"
  60.  
  61. boom = Instance.new("Sound")
  62. boom.Looped = false
  63. boom.Volume = 0.5
  64. boom.Pitch = 0.55
  65. boom.SoundId = "http://www.roblox.com/asset/?id=2691586"
  66.  
  67. flys = Instance.new("Sound")
  68. flys.Looped = true
  69. flys.Volume = 0.8
  70. flys.Pitch = 0.4
  71. flys.SoundId = "rbxasset://sounds\\Rocket whoosh 01.wav"
  72.  
  73. function getnoobs(pos,dist)
  74. local stoof = {}
  75. local mods = {}
  76. for _,v in pairs(workspace:children()) do
  77. if v:IsA("BasePart") then
  78. if (v.Position - pos).magnitude < dist and v.Anchored == false then
  79. table.insert(stoof,v)
  80. end
  81. elseif v:IsA("Model") and v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= char then
  82. if (v.Torso.Position - pos).magnitude < dist then
  83. table.insert(mods,v)
  84. end
  85. end
  86. for _,k in pairs(v:children()) do
  87. if k:IsA("BasePart") then
  88. if (k.Position - pos).magnitude < dist and k.Anchored == false then
  89. table.insert(stoof,k)
  90. end
  91. end
  92. for _,o in pairs(k:children()) do
  93. if o:IsA("BasePart") then
  94. if (o.Position - pos).magnitude < dist and o.Anchored == false then
  95. table.insert(stoof,o)
  96. end
  97. end
  98. end
  99. end
  100. end
  101. return stoof, mods
  102. end
  103.  
  104. for i,v in pairs(me.PlayerGui:children()) do
  105. if v.Name == screenname then v:remove() end
  106. end
  107.  
  108. screen = Instance.new("ScreenGui",me.PlayerGui)
  109. screen.Name = screenname
  110.  
  111. fra = Instance.new("Frame",screen)
  112. fra.Style = "RobloxRound"
  113. fra.Size = UDim2.new(0,120,0,25)
  114. fra.Position = UDim2.new(0.5,-60,0,0)
  115.  
  116. txt = Instance.new("TextLabel",fra)
  117. txt.BackgroundTransparency = 1
  118. txt.TextColor3 = Color3.new(1,1,1)
  119. txt.Size = UDim2.new(1,0,1,0)
  120. txt.Text = modes[order][1]
  121. txt.FontSize = "Size12"
  122.  
  123. fra2 = Instance.new("Frame",screen)
  124. fra2.BackgroundColor3 = Color3.new(0.1,0.2,0.4)
  125. fra2.Size = UDim2.new(0,240,0,19)
  126. fra2.Position = UDim2.new(0.5,-305,0,3)
  127.  
  128. energybar = Instance.new("Frame",fra2)
  129. energybar.Size = UDim2.new(Energy/MaxEnergy,0,1,0)
  130. energybar.BackgroundColor3 = Color3.new(0.1,0.3,0.9)
  131. energybar.BorderSizePixel = 0
  132.  
  133. entext = Instance.new("TextLabel",fra2)
  134. entext.BackgroundTransparency = 1
  135. entext.TextColor3 = Color3.new(1,1,1)
  136. entext.Size = UDim2.new(1,0,1,0)
  137. entext.Text = Energy.."/"..MaxEnergy
  138. entext.FontSize = "Size14"
  139.  
  140. sptext = Instance.new("TextLabel",fra)
  141. sptext.BackgroundTransparency = 1
  142. sptext.TextColor3 = Color3.new(1,1,1)
  143. sptext.Position = UDim2.new(1.1,0,0.5,0)
  144. sptext.Text = "0/0"
  145. sptext.TextXAlignment = "Left"
  146. sptext.FontSize = "Size14"
  147.  
  148. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  149. part.Parent = parent
  150. part.formFactor = form
  151. part.CanCollide = collide
  152. part.Transparency = tran
  153. part.Reflectance = ref
  154. part.Size = Vector3.new(x,y,z)
  155. part.BrickColor = BrickColor.new(color)
  156. part.TopSurface = 0
  157. part.BottomSurface = 0
  158. part.Anchored = anchor
  159. part.Locked = true
  160. part:BreakJoints()
  161. end
  162.  
  163. function weld(w, p, p1, a, b, c, x, y, z)
  164. w.Parent = p
  165. w.Part0 = p
  166. w.Part1 = p1
  167. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  168. end
  169.  
  170. function GetCF(pos1, pos2)
  171. local pos4 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
  172. return CFrame.new(pos1, pos4)
  173. end
  174.  
  175. rarm = char:findFirstChild("Right Arm")
  176. larm = char:findFirstChild("Left Arm")
  177. torso = char:findFirstChild("Torso")
  178. hum = char:findFirstChild("Humanoid")
  179.  
  180. coroutine.resume(coroutine.create(function()
  181. while true do
  182. if Flying == false then
  183. Energy = Energy + IncreaseEnergy
  184. end
  185. CheckEnergy()
  186. local mag = torso.Velocity.magnitude
  187. local lolmag = mag
  188. local col = nil
  189. sptext.Text = math.floor(mag).."/"..MaxSpeed
  190. if lolmag > MaxSpeed then
  191. lolmag = MaxSpeed
  192. sptext.TextColor3 = Color3.new(1, 0, 0.2)
  193. sptext.Text = sptext.Text.."!!"
  194. else
  195. sptext.TextColor3 = Color3.new(lolmag/MaxSpeed, (lolmag/MaxSpeed)/1.7, 0)
  196. end
  197. energybar.Size = UDim2.new(Energy/MaxEnergy,0,1,0)
  198. entext.Text = math.floor(Energy).."/"..math.floor(MaxEnergy)
  199. wait()
  200. end
  201. end))
  202.  
  203. flys.Parent = torso
  204.  
  205. bg = Instance.new("BodyGyro")
  206. bg.P = 18000
  207. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  208.  
  209. bv = Instance.new("BodyVelocity")
  210. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  211.  
  212. for i,v in pairs(char:children()) do
  213. if v.Name == name then v:remove() end
  214. end
  215.  
  216. launcher = Instance.new("Model")
  217. launcher.Name = name
  218.  
  219.  
  220. --[[LAUNCHER
  221. LAUNCHER
  222. LAUNCHER
  223. LAUNCHER
  224. LAUNCHER
  225. LAUNCHER
  226. LAUNCHER
  227. LAUNCHER
  228. ]]
  229.  
  230. main = Instance.new("Part")
  231. prop( main, launcher, false, 0, 0, 1.1, 0.6, 1.1, "Dark grey", false, "Custom" )
  232. mainmesh = Instance.new("SpecialMesh",main)
  233. mainmesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  234. mainmesh.Scale = Vector3.new(1.2,1.2,7)
  235. weaponweld = Instance.new("Weld")
  236. weld( weaponweld, rarm, main, math.pi / 2, 0, 0, 0, -0.3, 0 )
  237.  
  238. neck = Instance.new("Part")
  239. prop( neck, launcher, false, 0, 0, 0.6, 1, 0.6, "Medium grey", false, "Custom" )
  240. Instance.new("CylinderMesh",neck)
  241. neckweld = Instance.new("Weld")
  242. weld( neckweld, main, neck, 0, 0, 0, 0, 0, 0.1 )
  243.  
  244. pew = Instance.new("Part")
  245. prop( pew, launcher, false, 0, 0, 0.9, 0.9, 1.5, "Dark grey", false, "Custom" )
  246. Instance.new("SpecialMesh",pew).MeshType = "Sphere"
  247. mehweld = Instance.new("Weld")
  248. weld( mehweld, neck, pew, 0, 0, 0, 0, 0, -0.3 )
  249.  
  250. tube = Instance.new("Part")
  251. prop( tube, launcher, false, 0, 0, 0.9, 0.9, 1.5, "Medium grey", false, "Custom" )
  252. local tubemesh = mainmesh:clone()
  253. tubemesh.Parent = tube
  254. tubemesh.Scale = Vector3.new(0.9,0.9,8)
  255. lolweld = Instance.new("Weld")
  256. weld( lolweld, pew, tube, 0, 0, 0, 0, 0, 0.7 )
  257.  
  258. bewm.Parent = tube
  259.  
  260. missile = Instance.new("Part")
  261. prop( missile, launcher, false, 0, 0, 0.1, 1.2, 0.1, "Really red", false, "Custom" )
  262. local sp = Instance.new("SpecialMesh",missile)
  263. sp.MeshType = "Sphere" sp.Scale = Vector3.new(0.6,1,0.6)
  264. missweld = Instance.new("Weld")
  265. weld( missweld, tube, missile, math.pi/2, 0, 0, 0, 0, -0.1 )
  266.  
  267. for x = -0.31, -0.15, 0.15 do
  268. for i=0,360,60 do
  269. local miss = Instance.new("Part")
  270. prop( miss, launcher, false, 0, 0, 0.1, 1.2, 0.1, "Bright red", false, "Custom" )
  271. local sp = Instance.new("SpecialMesh",miss)
  272. sp.MeshType = "Sphere" sp.Scale = Vector3.new(0.6,1,0.6)
  273. local miweld = Instance.new("Weld")
  274. miweld.C0 = CFrame.Angles(0,math.rad(i),0)
  275. weld( miweld, missile, miss, 0, 0, 0, x, 0, 0 )
  276. end
  277. end
  278.  
  279. --[[JET
  280. JET
  281. JET
  282. JET
  283. JET
  284. JET
  285. ]]
  286.  
  287. Jets = {}
  288.  
  289. for i = -0.5, 0.5, 1 do
  290. local p = Instance.new("Part")
  291. prop(p, launcher, false, 0, 0, 1.2, 2.1, 0.2, "Medium grey", false, "Custom")
  292. local wl = Instance.new("Weld")
  293. weld(wl, torso, p, 0, 0, i, -i/1.3, 0, -0.5)
  294.  
  295. local jet = Instance.new("Part")
  296. prop(jet, launcher, false, 0, 0, 0.6, 1.7, 0.6, "Dark grey", false, "Custom")
  297. Instance.new("CylinderMesh",jet)
  298. local wa = Instance.new("Weld")
  299. weld(wa, p, jet, 0, 0, -i, i*4, 1.2, -1)
  300.  
  301. local ho = Instance.new("Part")
  302. prop(ho, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Medium grey", false, "Custom")
  303. local wad = Instance.new("Weld")
  304. weld(wad, jet, ho, math.pi/2, 0, 0, 0, 0.78, 0)
  305.  
  306. local jets = Instance.new("Part")
  307. prop(jets, launcher, false, 0, 0.05, 0.8, 1.4, 0.8, "Dark grey", false, "Custom")
  308. Instance.new("SpecialMesh",jets)
  309. local wa2 = Instance.new("Weld")
  310. weld(wa2, ho, jets, 0, 0, 0, 0, 0.5, 0)
  311.  
  312. local gas = Instance.new("Part")
  313. prop(gas, launcher, false, 0, 0, 1, 0.5, 1, "Medium grey", false, "Custom")
  314. Instance.new("SpecialMesh",gas)
  315. local wa3 = Instance.new("Weld")
  316. weld(wa3, jets, gas, 0, 0, 0, 0, 0.7, 0)
  317.  
  318. table.insert(Jets, {wa2, gas, jets})
  319.  
  320. for o = -0.3, 0.4, 0.6 do
  321. local p2 = Instance.new("Part")
  322. prop(p2, launcher, false, 0, 0.05, 0.8, 2.1, 0.2, "Dark grey", false, "Custom")
  323. local w2 = Instance.new("Weld")
  324. weld(w2, p, p2, -1.1, 0, o*1.6, -o*2.2, -1.26, -0.6)
  325. local p3 = Instance.new("Part")
  326. prop(p3, launcher, false, 0, 0, 1.3, 0.7, 0.4, "Bright red", false, "Custom")
  327. local w3 = Instance.new("Weld")
  328. weld(w3, p2, p3, 0, 0, 0, 0, -0.75, 0)
  329. end
  330. end
  331.  
  332. rb = Instance.new("Part")
  333. prop( rb, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  334. rh = Instance.new("Weld")
  335. weld( rh, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  336.  
  337. lb = Instance.new("Part")
  338. prop( lb, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  339. lh = Instance.new("Weld")
  340. weld( lh, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  341.  
  342. rw = Instance.new("Weld")
  343. weld(rw,rb,nil,0,0,0,0,0.5,0)
  344.  
  345. lw = Instance.new("Weld")
  346. weld(lw,lb,nil,0,0,0,0,0.5,0)
  347.  
  348. rightbattle = nil
  349. leftbattle = nil
  350.  
  351. launcher.Parent = char
  352.  
  353. selectmotion = function()
  354. rw.Part1 = rarm
  355. lw.Part1 = larm
  356. coroutine.resume(coroutine.create(function()
  357. for x = 0, 0.6, 0.1 do
  358. neckweld.C0 = CFrame.new(0,x*1.2,x/1.5)
  359. mehweld.C0 = CFrame.new(0,x,0)
  360. wait()
  361. end
  362. end))
  363. for i=0,90,10 do
  364. rw.C0 = CFrame.Angles(math.rad(i),0,0) * CFrame.new(math.rad(-i/3),math.rad(-i/4),0)
  365. lw.C0 = CFrame.Angles(math.rad(i),0,math.rad(i/2)) * CFrame.new(math.rad(i/3),math.rad(-i/1.7),0)
  366. wait()
  367. end
  368. if rightbattle == nil then
  369. rightbattle = rw.C0
  370. leftbattle = lw.C0
  371. end
  372. end
  373.  
  374. deselmotion = function()
  375. coroutine.resume(coroutine.create(function()
  376. for x = 0.6, 0, -0.1 do
  377. neckweld.C0 = CFrame.new(0,x*1.2,x)
  378. mehweld.C0 = CFrame.new(0,x,0)
  379. wait()
  380. end
  381. end))
  382. for i=90,0,-10 do
  383. rw.C0 = CFrame.Angles(math.rad(i),0,0) * CFrame.new(math.rad(-i/3),math.rad(-i/4),0)
  384. lw.C0 = CFrame.Angles(math.rad(i),0,math.rad(i/2)) * CFrame.new(math.rad(i/3),math.rad(-i/1.7),0)
  385. wait()
  386. end
  387. rw.Part1 = nil
  388. lw.Part1 = nil
  389. end
  390.  
  391. effect = function()
  392. local pos = tube.CFrame * CFrame.new(0,0,-0.8)
  393. local p = Instance.new("Part")
  394. prop( p, workspace, false, 0, 0, 1, 1, 1, "Neon orange", true, "Custom" )
  395. p.CFrame = pos
  396. local pwn = Instance.new("SpecialMesh",p)
  397. pwn.Scale = Vector3.new(0.5,0.4,0.5)
  398. pwn.MeshId = "http://www.roblox.com/asset/?id=20329976"
  399. for i=0.2,1.5,0.3 do
  400. pwn.Scale = Vector3.new(i,i/1.4,i)
  401. p.CFrame = pos * CFrame.Angles(-math.pi/2,i,0)
  402. p.Transparency = (i/1.5)-0.2
  403. wait()
  404. end
  405. p:remove()
  406. end
  407.  
  408. movearm = function()
  409. bewm:play()
  410. local rp, lp = rw.C0, lw.C0
  411. for i=0,30,30/2 do
  412. rw.C0 = rp * CFrame.Angles(math.rad(i/3),0,0) * CFrame.new(0,math.rad(i/3),0)
  413. lw.C0 = lp * CFrame.Angles(math.rad(i/5),0,0) * CFrame.new(0,math.rad(i/5),0)
  414. wait()
  415. end
  416. for i=30,0,-30/3 do
  417. rw.C0 = rp * CFrame.Angles(math.rad(i/3),0,0) * CFrame.new(0,math.rad(i/3),0)
  418. lw.C0 = lp * CFrame.Angles(math.rad(i/5),0,0) * CFrame.new(0,math.rad(i/5),0)
  419. wait()
  420. end
  421. end
  422.  
  423. explode = function(p,s,mo)
  424. s:stop()
  425. local exdmg = mo[4]
  426. local exdist = mo[2]
  427. local expl = Instance.new("Model",workspace)
  428. expl.Name = "xS explode"
  429. local pos = CFrame.new(p.Position)
  430. local parts, hums = getnoobs(pos.p, exdist)
  431. local p = Instance.new("Part")
  432. prop(p,expl,false,1,0,1,1,1,1,true,"Brick")
  433. p.CFrame = pos
  434. local poo = boom:clone()
  435. poo.Parent = p
  436. poo:play()
  437. for i,v in pairs(parts) do
  438. local minus = BrickDmg(exdmg, v, pos)
  439. if v:GetMass() < MassDestruct and v.Parent:findFirstChild("Humanoid") == nil and v.Parent ~= launcher then
  440. local hp = v:findFirstChild("Hp")
  441. if hp ~= nil then
  442. hp.Value = hp.Value - minus
  443. if hp.Value <= 0 then
  444. v:breakJoints()
  445. end
  446. else
  447. local lol = Instance.new("IntValue")
  448. lol.Name = "Hp"
  449. lol.Value = GiveHp(v:GetMass())
  450. lol.Parent = v
  451. lol.Changed:connect(function()
  452. if lol.Value <= 0 then
  453. v:breakJoints()
  454. end
  455. end)
  456. lol.Value = lol.Value - minus
  457. end
  458. end
  459. local teehee = minus*1.2
  460. v.Velocity = CFrame.new(pos.p, v.Position).lookVector * teehee
  461. v.RotVelocity = Vector3.new(math.random(-teehee,teehee), math.random(-teehee,teehee), math.random(-teehee,teehee))
  462. end
  463. for i,v in pairs(hums) do
  464. v.Humanoid.Health = v.Humanoid.Health - math.random(exdmg/1.3,exdmg*1.3)
  465. end
  466. for i=1,math.random(7,14) do
  467. local spike = Instance.new("Part")
  468. prop( spike, workspace, false, 0, 0, 1, 1, 1, explodecolors[math.random(1,#explodecolors)], true, "Custom" )
  469. local a,b,c = math.random(-32,32)/10, math.random(-32,32)/10, math.random(-32,32)/10
  470. spike.CFrame = pos * CFrame.Angles(a,b,c) * CFrame.new(0,exdist/6,0)
  471. local mes = Instance.new("SpecialMesh",spike)
  472. mes.MeshId = "http://www.roblox.com/asset/?id=1033714"
  473. mes.Scale = Vector3.new(math.random(exdist*1.3,exdist*2.5)/10,math.random(exdist*5,exdist*10)/10,math.random(exdist*1.3,exdist*2.5)/10)
  474. local cf = spike.CFrame
  475. coroutine.resume(coroutine.create(function()
  476. local wah = exdist*1.2
  477. for y=0,wah,math.random(wah/12,wah/7) do
  478. wait()
  479. spike.CFrame = cf * CFrame.new(0,y,0)
  480. spike.Transparency = (y/wah) - 0.08
  481. end
  482. spike:remove()
  483. end))
  484. end
  485. coroutine.resume(coroutine.create(function()
  486. for i=1,math.random(2,6) do
  487. wait()
  488. local siz = math.random((exdist/3)*10, (exdist/1.8)*10)/10
  489. local pk = Instance.new("Part")
  490. prop(pk, workspace, false, 0.1, 0, 1, 1, 1, explodecolors[math.random(1,#explodecolors)], true, "Custom" )
  491. pk.CFrame = pos * CFrame.new(math.random(-exdist*10,exdist*10)/25, math.random(-exdist*10,exdist*10)/25, math.random(-exdist*10,exdist*10)/25)
  492. local ms = Instance.new("SpecialMesh",pk)
  493. ms.MeshType = "Sphere"
  494. ms.Scale = Vector3.new(siz,siz,siz)
  495. coroutine.resume(coroutine.create(function()
  496. for x=0.1, 1, 0.15 do
  497. wait()
  498. pk.Transparency = x
  499. end
  500. pk:remove()
  501. end))
  502. end
  503. end))
  504. coroutine.resume(coroutine.create(function()
  505. for b=1,math.random(6,13) do
  506. wait()
  507. local siz = math.random((exdist/4)*10, (exdist/2.8)*10)/10
  508. local pk = Instance.new("Part")
  509. prop(pk, workspace, false, 0.1, 0, 1, 1, 1, sm[math.random(1,#sm)], true, "Custom" )
  510. pk.CFrame = pos * CFrame.new(math.random(-exdist*10,exdist*10)/25, math.random(-exdist*10,exdist*10)/25, math.random(-exdist*10,exdist*10)/25)
  511. local ms = Instance.new("SpecialMesh",pk)
  512. ms.MeshType = "Sphere"
  513. ms.Scale = Vector3.new(siz,siz,siz)
  514. local trul = pk.CFrame
  515. coroutine.resume(coroutine.create(function()
  516. for x=0.1, 1, 0.2 do
  517. wait()
  518. pk.Transparency = x
  519. pk.CFrame = trul * CFrame.Angles(math.random(-35,35)/100,math.random(-35,35)/100,math.random(-35,35)/100) * CFrame.new(0,x*4,0)
  520. end
  521. pk:remove()
  522. end))
  523. end
  524. end))
  525. wait(1)
  526. expl:remove()
  527. end
  528.  
  529. function smoke(p)
  530. while p.Parent ~= nil do
  531. wait(0.11)
  532. local siz = math.random(4,12)/10
  533. local sp = Instance.new("Part")
  534. prop(sp,workspace,false,0.1,0,siz,siz,siz,sm[math.random(1,#sm)],true,"Custom")
  535. sp.CFrame = p.CFrame * CFrame.new(0,0,0.8) * CFrame.Angles(math.random(-6,6)/10, math.random(-6,6)/10, math.random(-6,6)/10)
  536. local sme = Instance.new("SpecialMesh",sp)
  537. sme.MeshType = "Sphere"
  538. local c = sp.CFrame
  539. coroutine.resume(coroutine.create(function()
  540. for i=0.1, 1, 0.2 do
  541. wait()
  542. sp.CFrame = c * CFrame.new(0,0,i*4)
  543. sp.Transparency = i
  544. sme.Scale = Vector3.new(1+i,1+i,1+i)
  545. end
  546. sp:remove()
  547. end))
  548. end
  549. end
  550.  
  551. function smokejet(p)
  552. while Flying do
  553. wait(0.06)
  554. for _,v in pairs(p) do
  555. local siz = math.random(5,15)/10
  556. local sp = Instance.new("Part")
  557. prop(sp,workspace,false,0.1,0,siz,siz,siz,sm[math.random(1,#sm)],true,"Custom")
  558. sp.CFrame = v[2].CFrame * CFrame.new(0,-0.3,0) * CFrame.Angles(math.random(-6,6)/10, math.random(-6,6)/10, math.random(-6,6)/10)
  559. local sme = Instance.new("SpecialMesh",sp)
  560. sme.MeshType = "Sphere"
  561. local fi = Instance.new("Part")
  562. prop(fi,workspace,false,0.1,0,siz,siz,siz,explodecolors[math.random(1,#explodecolors)],true,"Custom")
  563. fi.CFrame = v[2].CFrame * CFrame.new(0,-0.3,0)* CFrame.Angles(math.pi,0,0) * CFrame.Angles(math.random(-3,3)/10, math.random(-3,3)/10, math.random(-3,3)/10)
  564. local fmes = Instance.new("SpecialMesh",fi)
  565. fmes.Scale = Vector3.new(0.4,0.5,0.4)
  566. fmes.MeshId = "http://www.roblox.com/asset/?id=20329976"
  567. local c, c2 = sp.CFrame, fi.CFrame
  568. coroutine.resume(coroutine.create(function()
  569. for i=0.1, 2, 0.18 do
  570. wait()
  571. sp.CFrame = c * CFrame.new(0,-i*3,0) + Vector3.new(0,i*4,0)
  572. sp.Transparency = i/2.2
  573. fi.Transparency = i/2
  574. fi.CFrame = c2 * CFrame.new(0,i*2,0)
  575. fmes.Scale = Vector3.new(0.4+(i/1.8),0.5+(i/1.8),0.4+(i/1.8))
  576. sme.Scale = Vector3.new(1+(i/1.4),1+(i/1.4),1+(i/1.4))
  577. end
  578. sp:remove()
  579. fi:remove()
  580. end))
  581. end
  582. end
  583. end
  584.  
  585. fly = function()
  586. if Flying == false and JetsOn == false and Energy >= EnergyCost then
  587. bv.Parent = torso
  588. Flying = true
  589. coroutine.resume(coroutine.create(function()
  590. smokejet(Jets, Flying)
  591. end))
  592. flys:play()
  593. Speed = MinSpeed
  594. while jethold do
  595. if Energy <= 0 then break end
  596. if Speed < MaxSpeed then
  597. Speed = Speed + SpeedIncrease
  598. else Speed = MaxSpeed end
  599. local cf = Jets[1][3].CFrame * CFrame.Angles(math.pi/2,0,0)
  600. bv.velocity = cf.lookVector * Speed
  601. Energy = Energy - EnergyCost
  602. wait()
  603. bv.velocity = Vector3.new(0,0,0)
  604. end
  605. local ha = math.random(1,2) if ha == 1 then flys:stop() else flys:pause() end
  606. bv.Parent = nil
  607. bv.velocity = Vector3.new(0,0,0)
  608. Speed = MinSpeed
  609. wait(0.3)
  610. Flying = false
  611. end
  612. end
  613.  
  614. fire = function(mousepos, pos, target)
  615.  
  616. local moda = mode
  617.  
  618. if Energy >= moda[7] then
  619. Energy = Energy - moda[7]
  620. coroutine.resume(coroutine.create(effect))
  621. local hitable = true
  622. local pewm = Instance.new("Part")
  623. prop( pewm, nil, false, 0, 0, 0.4, 0.4, 0.7, "Medium grey", false, "Custom" )
  624. Instance.new("SpecialMesh",pewm).MeshType = "Sphere"
  625.  
  626. local projectile = Instance.new("Part")
  627. prop( projectile, workspace, false, 0, 0, 0.3, 0.3, 1.3, "Bright red", false, "Custom" )
  628. Instance.new("SpecialMesh",projectile).MeshType = "Sphere"
  629.  
  630. local wi = Instance.new("Weld")
  631. weld(wi,projectile,nil,0,0,0,0,0,-0.4)
  632.  
  633. local swo = swoosh:clone()
  634. swo.Parent = projectile
  635. swo:play()
  636. local bv = nil
  637. local sped = 0
  638.  
  639. coroutine.resume(coroutine.create(function() wait(0.8) smoke(projectile) end))
  640. coroutine.resume(coroutine.create(function() wait(7) if projectile.Parent ~= nil then coroutine.resume(coroutine.create(function() explode(projectile, swo, moda) end)) projectile:remove() end end))
  641. coroutine.resume(coroutine.create(movearm))
  642. coroutine.resume(coroutine.create(function()
  643. repeat wait() until bv ~= nil
  644. if moda[1] == "Accelerate" then
  645. for i = moda[5], acceleratemax, accelerateincrease do
  646. sped = i
  647. wait()
  648. end
  649. else
  650. sped = moda[5]
  651. end
  652. end))
  653. projectile.Touched:connect(function(hit)
  654. if hit.CanCollide == true and hit:GetMass() >= 3.5 and hitable then
  655. coroutine.resume(coroutine.create(function() hitable = false explode(projectile, swo, moda) end))
  656. projectile:remove()
  657. end
  658. end)
  659. projectile.CFrame = pos * CFrame.new(0,0,-1)
  660. pewm.Parent = projectile
  661. pewm.CFrame = projectile.CFrame
  662. wi.Part1 = pewm
  663. local bg = Instance.new("BodyGyro")
  664. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  665. bg.P = moda[3]
  666. bg.Parent = projectile
  667. bg.cframe = CFrame.new(projectile.Position, projectile.CFrame * CFrame.new(0,0,-10).p)
  668. bv = Instance.new("BodyVelocity")
  669. bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  670. bv.velocity = projectile.CFrame.lookVector * sped
  671. bv.Parent = projectile
  672. if target ~= nil then
  673. local lolpos = target.CFrame:pointToObjectSpace(mousepos)
  674. repeat
  675. wait()
  676. bg.cframe = CFrame.new(projectile.Position, target.CFrame * CFrame.new(lolpos).p)
  677. bv.velocity = projectile.CFrame.lookVector * sped
  678. until (projectile.Position - target.CFrame * CFrame.new(lolpos).p).magnitude < 2
  679. if hitable then
  680. hitable = false
  681. coroutine.resume(coroutine.create(function() explode(projectile, swo, moda) end))
  682. projectile:remove()
  683. end
  684. else
  685. local lolaha = mousepos
  686. projectile.CFrame = CFrame.new(pos.p, mousepos)
  687. repeat
  688. wait()
  689. bv.velocity = projectile.CFrame.lookVector * sped
  690. bg.cframe = CFrame.new(projectile.Position, lolaha)
  691. until projectile.Parent == nil
  692. end
  693. end
  694. end
  695.  
  696. if script.Parent.className ~= "HopperBin" then
  697. h = Instance.new("HopperBin",me.Backpack)
  698. h.Name = "MiniRocket"
  699. script.Parent = h
  700. end
  701.  
  702. bin = script.Parent
  703.  
  704. function select(mouse)
  705. selectmotion()
  706. mouse.Icon = "http://www.roblox.com/asset/?id=45117007"
  707. sel = true
  708. coroutine.resume(coroutine.create(function()
  709. for i=1,4 do
  710. bg.Parent = nil
  711. wait()
  712. bg.Parent = torso
  713. end
  714. end))
  715. coroutine.resume(coroutine.create(function()
  716. while sel do
  717. local po = torso.Position+Vector3.new(0,0.85,0)
  718. local offset=(po.Y-mouse.Hit.p.Y)/60
  719. local mag=(po-mouse.Hit.p).magnitude/80
  720. offset=offset/mag
  721. torso.Neck.C0 = necko * CFrame.Angles(offset,0,0)
  722. rw.C0 = rightbattle * CFrame.Angles(-offset, 0,0)
  723. lw.C0 = leftbattle * CFrame.Angles(-offset,0,0)
  724. for i,v in pairs(Jets) do
  725. v[1].C0 = CFrame.Angles(offset,0,0)
  726. end
  727. bg.cframe = GetCF(torso.Position, mouse.Hit.p)
  728. wait()
  729. end --Fenrier was here o3o
  730. rw.C0 = rightbattle
  731. lw.C0 = leftbattle
  732. torso.Neck.C0 = necko
  733. end))
  734. mouse.Button1Down:connect(function()
  735. hold = true
  736. while hold do
  737. coroutine.resume(coroutine.create(function() fire(mouse.Hit.p, tube.CFrame, mouse.Target) end))
  738. for i=0,mode[6],0.03 do
  739. if hold == false then break end
  740. wait()
  741. end
  742. end
  743. end)
  744. mouse.Button1Up:connect(function() hold = false end)
  745. mouse.KeyDown:connect(function(key)
  746. key = key:lower()
  747. if key == "e" then
  748. order = order + 1
  749. if order > #modes then
  750. order = 1
  751. end
  752. mode = modes[order]
  753. txt.Text = mode[1]
  754. elseif key == "q" then
  755. order = order - 1
  756. if order < 1 then
  757. order = #modes
  758. end
  759. mode = modes[order]
  760. txt.Text = mode[1]
  761. elseif key == string.char(48) then
  762. jethold = true
  763. fly()
  764. end
  765. end)
  766. mouse.KeyUp:connect(function(key)
  767. key = key:lower()
  768. if key == string.char(48) then
  769. jethold = false
  770. end
  771. end)
  772. end
  773.  
  774. function desel()
  775. sel = false
  776. bg.Parent = nil
  777. deselmotion()
  778. end
  779.  
  780. bin.Selected:connect(select)
  781. bin.Deselected:connect(desel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement