Advertisement
Guest User

Untitled

a guest
May 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.83 KB | None | 0 0
  1. --Created with PenguinAnonymous's compiler
  2. --PenguinAnonymous is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors: Terrain,Camera,TouchTransmitter
  11. local mess_handle=Instance.new("Message",workspace)
  12. mess_handle.Text = "Inserting map, please wait"
  13. wait(0.5)
  14. for i,w in pairs(workspace:GetChildren()) do
  15. if w.className~="Terrain" then
  16. if (w~=mess_handle)and(w~=script) then
  17. ypcall(function() w:Destroy() end)
  18. end
  19. end
  20. end
  21.  
  22. local runDummyScript = function(f,scri)
  23. local oldenv = getfenv(f)
  24. local newenv = setmetatable({}, {
  25. __index = function(_, k)
  26. if k:lower() == 'script' then
  27. return scri
  28. else
  29. return oldenv[k]
  30. end
  31. end
  32. })
  33. setfenv(f, newenv)
  34. ypcall(function() f() end)
  35. end
  36. cors = {}
  37. mas = Instance.new("Model",game:GetService("Lighting"))
  38. mas.Name = "CompiledModel"
  39. o3 = Instance.new("Model")
  40. o4 = Instance.new("Part")
  41. o5 = Instance.new("Model")
  42. o6 = Instance.new("Part")
  43. o7 = Instance.new("ManualWeld")
  44. o8 = Instance.new("Part")
  45. o9 = Instance.new("Part")
  46. o10 = Instance.new("Part")
  47. o11 = Instance.new("Tool")
  48. o12 = Instance.new("Part")
  49. o13 = Instance.new("SpecialMesh")
  50. o15 = Instance.new("Script")
  51. o16 = Instance.new("Script")
  52. o17 = Instance.new("LocalScript")
  53. o18 = Instance.new("Part")
  54. o19 = Instance.new("Part")
  55. o20 = Instance.new("ManualWeld")
  56. o21 = Instance.new("Part")
  57. o22 = Instance.new("Part")
  58. o23 = Instance.new("ManualWeld")
  59. o24 = Instance.new("Part")
  60. o25 = Instance.new("ManualWeld")
  61. o26 = Instance.new("ManualWeld")
  62. o27 = Instance.new("ManualWeld")
  63. o28 = Instance.new("Part")
  64. o29 = Instance.new("ManualWeld")
  65. o30 = Instance.new("Tool")
  66. o31 = Instance.new("Part")
  67. o32 = Instance.new("SpecialMesh")
  68. o33 = Instance.new("ManualWeld")
  69. o35 = Instance.new("LocalScript")
  70. o36 = Instance.new("Sound")
  71. o37 = Instance.new("Sound")
  72. o38 = Instance.new("Script")
  73. o39 = Instance.new("LocalScript")
  74. o40 = Instance.new("Part")
  75. o3.Parent = mas
  76. o4.Parent = o3
  77. o4.BrickColor = BrickColor.new("Grime")
  78. o4.Position = Vector3.new(-4.5, -0.5, 1)
  79. o4.Anchored = true
  80. o4.Size = Vector3.new(883, 1, 838)
  81. o4.CFrame = CFrame.new(-4.5, -0.5, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  82. o4.Color = Color3.new(0.498039, 0.556863, 0.392157)
  83. o4.Position = Vector3.new(-4.5, -0.5, 1)
  84. o5.Parent = o3
  85. o6.Parent = o5
  86. o6.BrickColor = BrickColor.new("Pearl")
  87. o6.Position = Vector3.new(25.5, 15.9999943, 4.5)
  88. o6.Anchored = true
  89. o6.Size = Vector3.new(1, 10, 49)
  90. o6.CFrame = CFrame.new(25.5, 15.9999943, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  91. o6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  92. o6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  93. o6.Color = Color3.new(0.905882, 0.905882, 0.92549)
  94. o6.Position = Vector3.new(25.5, 15.9999943, 4.5)
  95. o7.Name = "Part-to-Part Strong Joint"
  96. o7.Parent = o6
  97. o7.C0 = CFrame.new(-0.5, -5, 24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  98. o7.C1 = CFrame.new(24.5, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  99. o7.Part0 = o6
  100. o7.Part1 = o19
  101. o8.Parent = o5
  102. o8.BrickColor = BrickColor.new("Really red")
  103. o8.Position = Vector3.new(0.5, 21.4999962, 4.5)
  104. o8.Anchored = true
  105. o8.Size = Vector3.new(51, 1, 51)
  106. o8.CFrame = CFrame.new(0.5, 21.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  107. o8.Color = Color3.new(1, 0, 0)
  108. o8.Position = Vector3.new(0.5, 21.4999962, 4.5)
  109. o9.Parent = o5
  110. o9.BrickColor = BrickColor.new("Really red")
  111. o9.Position = Vector3.new(0.5, 23.4999962, 4.5)
  112. o9.Anchored = true
  113. o9.Size = Vector3.new(51, 1, 47)
  114. o9.CFrame = CFrame.new(0.5, 23.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  115. o9.Color = Color3.new(1, 0, 0)
  116. o9.Position = Vector3.new(0.5, 23.4999962, 4.5)
  117. o10.Parent = o5
  118. o10.BrickColor = BrickColor.new("Dark stone grey")
  119. o10.Position = Vector3.new(0.5, 0.500001013, 4.5)
  120. o10.Anchored = true
  121. o10.Size = Vector3.new(51, 1, 51)
  122. o10.CFrame = CFrame.new(0.5, 0.500001013, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  123. o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
  124. o10.Position = Vector3.new(0.5, 0.500001013, 4.5)
  125. o11.Name = "ClassicTimebomb"
  126. o11.Parent = o5
  127. o11.TextureId = "rbxasset://Textures/Bomb.png"
  128. o11.GripForward = Vector3.new(-0, 1, -0)
  129. o11.GripUp = Vector3.new(0, 0, 1)
  130. o12.Name = "Handle"
  131. o12.Parent = o11
  132. o12.Position = Vector3.new(-21.579998, 11.8800116, 13.3701639)
  133. o12.Rotation = Vector3.new(-89.9499969, 0, 180)
  134. o12.Anchored = true
  135. o12.FormFactor = Enum.FormFactor.Symmetric
  136. o12.Shape = Enum.PartType.Ball
  137. o12.Size = Vector3.new(2, 2, 2)
  138. o12.CFrame = CFrame.new(-21.579998, 11.8800116, 13.3701639, -1.00000298, -7.90887407e-06, -6.02934449e-07, 1.78755056e-06, -0.000796278182, 1.00000131, -7.90788454e-06, 1.0000037, 0.000796279695)
  139. o12.BottomSurface = Enum.SurfaceType.Smooth
  140. o12.TopSurface = Enum.SurfaceType.Smooth
  141. o12.Position = Vector3.new(-21.579998, 11.8800116, 13.3701639)
  142. o13.Parent = o12
  143. o13.MeshId = "rbxasset://fonts/timebomb.mesh"
  144. o13.TextureId = "rbxasset://textures/bombtex.png"
  145. o13.MeshType = Enum.MeshType.FileMesh
  146. o15.Name = "PlantBomb"
  147. o15.Parent = o11
  148. table.insert(cors,coroutine.create(function()
  149. wait()
  150. runDummyScript(function()
  151. local bombScript = script.Parent.Bomb
  152. local Tool = script.Parent
  153. local Bomb = Tool.Handle
  154.  
  155. function plant()
  156. local bomb2 = Instance.new("Part")
  157.  
  158. local vCharacter = Tool.Parent
  159. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  160.  
  161. local spawnPos = Bomb.Position
  162.  
  163. bomb2.Position = Vector3.new(spawnPos.x, spawnPos.y+3, spawnPos.z)
  164. bomb2.Size = Vector3.new(2,2,2)
  165.  
  166. bomb2.BrickColor = BrickColor.new(21)
  167. bomb2.Shape = 0
  168. bomb2.BottomSurface = 0
  169. bomb2.TopSurface = 0
  170. bomb2.Reflectance = 1
  171. bomb2.Name = "TimeBomb"
  172. bomb2.Locked = true
  173.  
  174. local creator_tag = Instance.new("ObjectValue")
  175. creator_tag.Value = vPlayer
  176. creator_tag.Name = "creator"
  177. creator_tag.Parent = bomb2
  178.  
  179. bomb2.Parent = game.Workspace
  180. local new_script = bombScript:clone()
  181. new_script.Disabled = false
  182. new_script.Parent = bomb2
  183. end
  184.  
  185.  
  186. Tool.Enabled = true
  187. function onActivated()
  188.  
  189. if not Tool.Enabled then
  190. return
  191. end
  192.  
  193. Tool.Enabled = false
  194.  
  195. local character = Tool.Parent;
  196. local humanoid = character.Humanoid
  197. if humanoid == nil then
  198. print("Humanoid not found")
  199. return
  200. end
  201.  
  202. local targetPos = humanoid.TargetPoint
  203. Bomb.Transparency = 1.0
  204.  
  205. plant()
  206.  
  207. wait(6)
  208. Bomb.Transparency = 0.0
  209.  
  210. Tool.Enabled = true
  211. end
  212.  
  213. function onUnequipped()
  214. end
  215.  
  216.  
  217. Tool.Activated:connect(onActivated)
  218. Tool.Unequipped:connect(onUnequipped)
  219. end,o15)
  220. end))
  221. o16.Name = "Bomb"
  222. o16.Parent = o11
  223. o16.Disabled = true
  224. table.insert(cors,coroutine.create(function()
  225. wait()
  226. runDummyScript(function()
  227. local updateInterval = .4
  228.  
  229. local currentColor = 1
  230. local colors = {26, 21}
  231.  
  232. local ticksound = Instance.new("Sound")
  233. ticksound.SoundId = "rbxasset://sounds\\clickfast.wav"
  234. ticksound.Parent = script.Parent
  235.  
  236. function update()
  237. updateInterval = updateInterval * .9
  238. script.Parent.BrickColor = BrickColor.new(colors[currentColor])
  239. currentColor = currentColor + 1
  240. if (currentColor > 2) then currentColor = 1 end
  241. end
  242.  
  243.  
  244. function blowUp()
  245. local sound = Instance.new("Sound")
  246. sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
  247. sound.Parent = script.Parent
  248. sound.Volume = 1
  249. sound:play()
  250. explosion = Instance.new("Explosion")
  251. explosion.BlastRadius = 12
  252. explosion.BlastPressure = 1000000 -- these are really wussy units
  253.  
  254. -- find instigator tag
  255. local creator = script.Parent:findFirstChild("creator")
  256. if creator ~= nil then
  257. explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
  258. end
  259.  
  260. explosion.Position = script.Parent.Position
  261. explosion.Parent = game.Workspace
  262. script.Parent.Transparency = 1
  263. end
  264.  
  265. function onPlayerBlownUp(part, distance, creator)
  266. if part.Name == "Head" then
  267. local humanoid = part.Parent.Humanoid
  268. tagHumanoid(humanoid, creator)
  269. end
  270. end
  271.  
  272. function tagHumanoid(humanoid, creator)
  273. -- tag does not need to expire iff all explosions lethal
  274. if creator ~= nil then
  275. local new_tag = creator:clone()
  276. new_tag.Parent = humanoid
  277. end
  278. end
  279.  
  280. function untagHumanoid(humanoid)
  281. if humanoid ~= nil then
  282. local tag = humanoid:findFirstChild("creator")
  283. if tag ~= nil then
  284. tag.Parent = nil
  285. end
  286. end
  287. end
  288.  
  289. while updateInterval > .1 do
  290. wait(updateInterval)
  291. update()
  292. ticksound:play()
  293. end
  294.  
  295. blowUp()
  296. wait(2)
  297. script.Parent:remove()
  298.  
  299. end,o16)
  300. end))
  301. o17.Name = "MouseIcon"
  302. o17.Parent = o11
  303. table.insert(cors,coroutine.create(function()
  304. wait()
  305. runDummyScript(function()
  306. local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
  307. local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
  308.  
  309. local Tool = script.Parent
  310.  
  311. local Mouse = nil
  312.  
  313. local function UpdateIcon()
  314. if Mouse then
  315. Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
  316. end
  317. end
  318.  
  319. local function OnEquipped(mouse)
  320. Mouse = mouse
  321. UpdateIcon()
  322. end
  323.  
  324. local function OnChanged(property)
  325. if property == 'Enabled' then
  326. UpdateIcon()
  327. end
  328. end
  329.  
  330. Tool.Equipped:connect(OnEquipped)
  331. Tool.Changed:connect(OnChanged)
  332.  
  333. end,o17)
  334. end))
  335. o18.Parent = o5
  336. o18.BrickColor = BrickColor.new("Pearl")
  337. o18.Position = Vector3.new(25.5, 5.99999714, 20)
  338. o18.Anchored = true
  339. o18.Size = Vector3.new(1, 10, 18)
  340. o18.CFrame = CFrame.new(25.5, 5.99999714, 20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  341. o18.Color = Color3.new(0.905882, 0.905882, 0.92549)
  342. o18.Position = Vector3.new(25.5, 5.99999714, 20)
  343. o19.Parent = o5
  344. o19.BrickColor = BrickColor.new("Pearl")
  345. o19.Position = Vector3.new(0.5, 10.9999943, 29.5)
  346. o19.Anchored = true
  347. o19.Size = Vector3.new(51, 20, 1)
  348. o19.CFrame = CFrame.new(0.5, 10.9999943, 29.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  349. o19.Color = Color3.new(0.905882, 0.905882, 0.92549)
  350. o19.Position = Vector3.new(0.5, 10.9999943, 29.5)
  351. o20.Name = "Part-to-Part Strong Joint"
  352. o20.Parent = o19
  353. o20.C0 = CFrame.new(25.5, -10, -0.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  354. o20.C1 = CFrame.new(0.5, -5, 9, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  355. o20.Part0 = o19
  356. o20.Part1 = o18
  357. o21.Parent = o5
  358. o21.BrickColor = BrickColor.new("Pearl")
  359. o21.Position = Vector3.new(25.5, 10.4999943, -1.5)
  360. o21.Anchored = true
  361. o21.Size = Vector3.new(1, 1, 1)
  362. o21.CFrame = CFrame.new(25.5, 10.4999943, -1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  363. o21.BottomSurface = Enum.SurfaceType.Hinge
  364. o21.Color = Color3.new(0.905882, 0.905882, 0.92549)
  365. o21.Position = Vector3.new(25.5, 10.4999943, -1.5)
  366. o22.Parent = o5
  367. o22.BrickColor = BrickColor.new("Pearl")
  368. o22.Position = Vector3.new(-24.5, 10.9999943, 4.5)
  369. o22.Anchored = true
  370. o22.Size = Vector3.new(1, 20, 49)
  371. o22.CFrame = CFrame.new(-24.5, 10.9999943, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  372. o22.Color = Color3.new(0.905882, 0.905882, 0.92549)
  373. o22.Position = Vector3.new(-24.5, 10.9999943, 4.5)
  374. o23.Name = "Part-to-Part Strong Joint"
  375. o23.Parent = o22
  376. o23.C0 = CFrame.new(-0.5, -10, 24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  377. o23.C1 = CFrame.new(-25.5, -10, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  378. o23.Part0 = o22
  379. o23.Part1 = o19
  380. o24.Parent = o5
  381. o24.BrickColor = BrickColor.new("Pearl")
  382. o24.Position = Vector3.new(0.5, 10.9999943, -20.5)
  383. o24.Anchored = true
  384. o24.Size = Vector3.new(51, 20, 1)
  385. o24.CFrame = CFrame.new(0.5, 10.9999943, -20.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  386. o24.Color = Color3.new(0.905882, 0.905882, 0.92549)
  387. o24.Position = Vector3.new(0.5, 10.9999943, -20.5)
  388. o25.Name = "Part-to-Part Strong Joint"
  389. o25.Parent = o24
  390. o25.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  391. o25.C1 = CFrame.new(-0.5, -10, -24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  392. o25.Part0 = o24
  393. o25.Part1 = o22
  394. o26.Name = "Part-to-Part Strong Joint"
  395. o26.Parent = o24
  396. o26.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  397. o26.C1 = CFrame.new(-50.5, -15, -24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  398. o26.Part0 = o24
  399. o26.Part1 = o6
  400. o27.Name = "Part-to-Part Strong Joint"
  401. o27.Parent = o24
  402. o27.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  403. o27.C1 = CFrame.new(-50.5, -5, -9, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  404. o27.Part0 = o24
  405. o27.Part1 = o28
  406. o28.Parent = o5
  407. o28.BrickColor = BrickColor.new("Pearl")
  408. o28.Position = Vector3.new(25.5, 5.99999714, -11)
  409. o28.Anchored = true
  410. o28.Size = Vector3.new(1, 10, 18)
  411. o28.CFrame = CFrame.new(25.5, 5.99999714, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  412. o28.Color = Color3.new(0.905882, 0.905882, 0.92549)
  413. o28.Position = Vector3.new(25.5, 5.99999714, -11)
  414. o29.Name = "Part-to-Part Strong Joint"
  415. o29.Parent = o28
  416. o29.C0 = CFrame.new(-0.5, -5, 9, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  417. o29.C1 = CFrame.new(-0.5, -9.5, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  418. o29.Part0 = o28
  419. o29.Part1 = o21
  420. o30.Name = "RocketLauncher"
  421. o30.Parent = o5
  422. o30.TextureId = "http://www.roblox.com/asset/?id=90021376"
  423. o30.GripForward = Vector3.new(1, -0, -0)
  424. o30.GripPos = Vector3.new(0.699999988, 0, -0.5)
  425. o30.GripRight = Vector3.new(0, -1, 0)
  426. o30.GripUp = Vector3.new(0, 0, 1)
  427. o30.CanBeDropped = false
  428. o31.Name = "Handle"
  429. o31.Parent = o30
  430. o31.Position = Vector3.new(-23, 9.42003155, 13)
  431. o31.Rotation = Vector3.new(-90, -90, 0)
  432. o31.Anchored = true
  433. o31.CanCollide = false
  434. o31.FormFactor = Enum.FormFactor.Custom
  435. o31.Size = Vector3.new(4.92000628, 0.740000546, 0.839999795)
  436. o31.CFrame = CFrame.new(-23, 9.42003155, 13, -5.96046448e-07, 0, -1.00000179, 1.00000095, 6.30171271e-05, 5.96046448e-07, 6.30170543e-05, -1.00000215, 3.63797881e-11)
  437. o31.BottomSurface = Enum.SurfaceType.Smooth
  438. o31.TopSurface = Enum.SurfaceType.Smooth
  439. o31.Position = Vector3.new(-23, 9.42003155, 13)
  440. o32.Parent = o31
  441. o32.MeshId = "rbxasset://fonts/rocketlauncher.mesh"
  442. o32.Scale = Vector3.new(0.75, 0.75, 0.75)
  443. o32.TextureId = "rbxasset://textures/rocketlaunchertex.png"
  444. o32.MeshType = Enum.MeshType.FileMesh
  445. o33.Name = "Handle-to-Handle Strong Joint"
  446. o33.Parent = o31
  447. o33.C0 = CFrame.new(2.46000314, -0.370000273, -0.419999897, -0.99999994, 0, 0, 0, 1, 0, 0, 0, -0.99999994)
  448. o33.C1 = CFrame.new(1, 0, 0, -1.19100412e-06, 7.90797912e-06, -1.00000131, 0.000733260298, -1.00000155, -7.90929789e-06, -1.00000048, -0.000733261055, -6.88774593e-09)
  449. o33.Part0 = o31
  450. o33.Part1 = o12
  451. o35.Name = "Launcher"
  452. o35.Parent = o30
  453. table.insert(cors,coroutine.create(function()
  454. wait()
  455. runDummyScript(function()
  456. -----------------
  457. --| Constants |--
  458. -----------------
  459.  
  460. local GRAVITY_ACCELERATION = 196.2
  461.  
  462. local RELOAD_TIME = 3 -- Seconds until tool can be used again
  463. local ROCKET_SPEED = 60 -- Speed of the projectile
  464.  
  465. local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
  466. local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
  467. local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
  468.  
  469. -----------------
  470. --| Variables |--
  471. -----------------
  472.  
  473. local DebrisService = Game:GetService('Debris')
  474. local PlayersService = Game:GetService('Players')
  475.  
  476. local MyPlayer = PlayersService.LocalPlayer
  477.  
  478. local Tool = script.Parent
  479. local ToolHandle = Tool.Handle
  480.  
  481. local RocketScript = script:WaitForChild('Rocket')
  482. local SwooshSound = script:WaitForChild('Swoosh')
  483. local BoomSound = script:WaitForChild('Boom')
  484.  
  485. --NOTE: We create the rocket once and then clone it when the player fires
  486. local Rocket = Instance.new('Part') do
  487. -- Set up the rocket part
  488. Rocket.Name = 'Rocket'
  489. Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
  490. Rocket.Size = ROCKET_PART_SIZE
  491. Rocket.CanCollide = false
  492.  
  493. -- Add the mesh
  494. local mesh = Instance.new('SpecialMesh', Rocket)
  495. mesh.MeshId = MISSILE_MESH_ID
  496. mesh.Scale = MISSILE_MESH_SCALE
  497.  
  498. -- Add fire
  499. local fire = Instance.new('Fire', Rocket)
  500. fire.Heat = 5
  501. fire.Size = 2
  502.  
  503. -- Add a force to counteract gravity
  504. local bodyForce = Instance.new('BodyForce', Rocket)
  505. bodyForce.Name = 'Antigravity'
  506. bodyForce.force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)
  507.  
  508. -- Clone the sounds and set Boom to PlayOnRemove
  509. local swooshSoundClone = SwooshSound:Clone()
  510. swooshSoundClone.Parent = Rocket
  511. local boomSoundClone = BoomSound:Clone()
  512. boomSoundClone.PlayOnRemove = true
  513. boomSoundClone.Parent = Rocket
  514.  
  515. -- Attach creator tags to the rocket early on
  516. local creatorTag = Instance.new('ObjectValue', Rocket)
  517. creatorTag.Value = MyPlayer
  518. creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
  519. local iconTag = Instance.new('StringValue', creatorTag)
  520. iconTag.Value = Tool.TextureId
  521. iconTag.Name = 'icon'
  522.  
  523. -- Finally, clone the rocket script and enable it
  524. local rocketScriptClone = RocketScript:Clone()
  525. rocketScriptClone.Parent = Rocket
  526. rocketScriptClone.Disabled = false
  527. end
  528.  
  529. -----------------
  530. --| Functions |--
  531. -----------------
  532.  
  533. local function OnActivated()
  534. local myModel = MyPlayer.Character
  535. if Tool.Enabled and myModel and myModel:FindFirstChild('Humanoid') and myModel.Humanoid.Health > 0 then
  536. Tool.Enabled = false
  537.  
  538. -- Create a clone of Rocket and set its color
  539. local rocketClone = Rocket:Clone()
  540. DebrisService:AddItem(rocketClone, 30)
  541. rocketClone.BrickColor = MyPlayer.TeamColor
  542.  
  543. -- Position the rocket clone and launch!
  544. local spawnPosition = (ToolHandle.CFrame * CFrame.new(2, 0, 0)).p
  545. rocketClone.CFrame = CFrame.new(spawnPosition, myModel.Humanoid.TargetPoint) --NOTE: This must be done before assigning Parent
  546. rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
  547. rocketClone.Parent = Workspace
  548.  
  549. wait(RELOAD_TIME)
  550.  
  551. Tool.Enabled = true
  552. end
  553. end
  554.  
  555. --------------------
  556. --| Script Logic |--
  557. --------------------
  558.  
  559. Tool.Activated:connect(OnActivated)
  560.  
  561. end,o35)
  562. end))
  563. o36.Name = "Swoosh"
  564. o36.Parent = o35
  565. o36.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
  566. o36.Volume = 0.69999998807907
  567. o36.Looped = true
  568. o37.Name = "Boom"
  569. o37.Parent = o35
  570. o37.SoundId = "rbxasset://sounds/collide.wav"
  571. o37.Volume = 1
  572. o38.Name = "Rocket"
  573. o38.Parent = o35
  574. o38.Disabled = true
  575. table.insert(cors,coroutine.create(function()
  576. wait()
  577. runDummyScript(function()
  578. -----------------
  579. --| Constants |--
  580. -----------------
  581.  
  582. local BLAST_RADIUS = 8 -- Blast radius of the explosion
  583. local BLAST_DAMAGE = 60 -- Amount of damage done to players
  584. local BLAST_FORCE = 1000 -- Amount of force applied to parts
  585.  
  586. local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
  587. --NOTE: Keys must be lowercase, values must evaluate to true
  588.  
  589. -----------------
  590. --| Variables |--
  591. -----------------
  592.  
  593. local DebrisService = Game:GetService('Debris')
  594. local PlayersService = Game:GetService('Players')
  595.  
  596. local Rocket = script.Parent
  597.  
  598. local CreatorTag = Rocket:WaitForChild('creator')
  599. local SwooshSound = Rocket:WaitForChild('Swoosh')
  600.  
  601. -----------------
  602. --| Functions |--
  603. -----------------
  604.  
  605. -- Removes any old creator tags and applies a new one to the target
  606. local function ApplyTags(target)
  607. while target:FindFirstChild('creator') do
  608. target.creator:Destroy()
  609. end
  610.  
  611. local creatorTagClone = CreatorTag:Clone()
  612. DebrisService:AddItem(creatorTagClone, 1.5)
  613. creatorTagClone.Parent = target
  614. end
  615.  
  616. -- Returns the ancestor that contains a Humanoid, if it exists
  617. local function FindCharacterAncestor(subject)
  618. if subject and subject ~= Workspace then
  619. local humanoid = subject:FindFirstChild('Humanoid')
  620. if humanoid then
  621. return subject, humanoid
  622. else
  623. return FindCharacterAncestor(subject.Parent)
  624. end
  625. end
  626. return nil
  627. end
  628.  
  629. -- Customized explosive effect that doesn't affect teammates and only breaks joints on dead parts
  630. local function OnExplosionHit(hitPart, hitDistance, blastCenter)
  631. if hitPart and hitDistance then
  632. local character, humanoid = FindCharacterAncestor(hitPart.Parent)
  633.  
  634. if character then
  635. local myPlayer = CreatorTag.Value
  636. if myPlayer and not myPlayer.Neutral then -- Ignore friendlies caught in the blast
  637. local player = PlayersService:GetPlayerFromCharacter(character)
  638. if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
  639. return
  640. end
  641. end
  642. end
  643.  
  644. if humanoid and humanoid.Health > 0 then -- Humanoids are tagged and damaged
  645. if hitPart.Name == 'Torso' then
  646. ApplyTags(humanoid)
  647. humanoid:TakeDamage(BLAST_DAMAGE)
  648. end
  649. else -- Loose parts and dead parts are blasted
  650. if hitPart.Name ~= 'Handle' then
  651. hitPart:BreakJoints()
  652. local blastForce = Instance.new('BodyForce', hitPart) --NOTE: We will multiply by mass so bigger parts get blasted more
  653. blastForce.force = (hitPart.Position - blastCenter).unit * BLAST_FORCE * hitPart:GetMass()
  654. DebrisService:AddItem(blastForce, 0.1)
  655. end
  656. end
  657. end
  658. end
  659.  
  660. local function OnTouched(otherPart)
  661. if Rocket and otherPart then
  662. -- Fly through anything in the ignore list
  663. if IGNORE_LIST[string.lower(otherPart.Name)] then
  664. return
  665. end
  666.  
  667. local myPlayer = CreatorTag.Value
  668. if myPlayer then
  669. -- Fly through the creator
  670. if myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
  671. return
  672. end
  673.  
  674. -- Fly through friendlies
  675. if not myPlayer.Neutral then
  676. local character = FindCharacterAncestor(otherPart.Parent)
  677. local player = PlayersService:GetPlayerFromCharacter(character)
  678. if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
  679. return
  680. end
  681. end
  682. end
  683.  
  684. -- Fly through terrain water
  685. if otherPart == Workspace.Terrain then
  686. --NOTE: If the rocket is large, then the simplifications made here will cause it to fly through terrain in some cases
  687. local frontOfRocket = Rocket.Position + (Rocket.CFrame.lookVector * (Rocket.Size.Z / 2))
  688. local cellLocation = Workspace.Terrain:WorldToCellPreferSolid(frontOfRocket)
  689. local cellMaterial = Workspace.Terrain:GetCell(cellLocation.X, cellLocation.Y, cellLocation.Z)
  690. if cellMaterial == Enum.CellMaterial.Water or cellMaterial == Enum.CellMaterial.Empty then
  691. return
  692. end
  693. end
  694.  
  695. -- Create the explosion
  696. local explosion = Instance.new('Explosion')
  697. explosion.BlastPressure = 0 -- Completely safe explosion
  698. explosion.BlastRadius = BLAST_RADIUS
  699. explosion.ExplosionType = Enum.ExplosionType.NoCraters
  700. explosion.Position = Rocket.Position
  701. explosion.Parent = Workspace
  702.  
  703. -- Connect custom logic for the explosion
  704. explosion.Hit:connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end)
  705.  
  706. -- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
  707. script.Parent = explosion
  708. CreatorTag.Parent = script
  709. Rocket:Destroy()
  710. end
  711. end
  712.  
  713. --------------------
  714. --| Script Logic |--
  715. --------------------
  716.  
  717. SwooshSound:Play()
  718.  
  719. Rocket.Touched:connect(OnTouched)
  720.  
  721. end,o38)
  722. end))
  723. o39.Name = "MouseIcon"
  724. o39.Parent = o30
  725. table.insert(cors,coroutine.create(function()
  726. wait()
  727. runDummyScript(function()
  728. local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
  729. local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
  730.  
  731. local Tool = script.Parent
  732.  
  733. local Mouse = nil
  734.  
  735. local function UpdateIcon()
  736. if Mouse then
  737. Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
  738. end
  739. end
  740.  
  741. local function OnEquipped(mouse)
  742. Mouse = mouse
  743. UpdateIcon()
  744. end
  745.  
  746. local function OnChanged(property)
  747. if property == 'Enabled' then
  748. UpdateIcon()
  749. end
  750. end
  751.  
  752. Tool.Equipped:connect(OnEquipped)
  753. Tool.Changed:connect(OnChanged)
  754.  
  755. end,o39)
  756. end))
  757. o40.Parent = o5
  758. o40.BrickColor = BrickColor.new("Really red")
  759. o40.Position = Vector3.new(0.5, 22.4999962, 4.5)
  760. o40.Anchored = true
  761. o40.Size = Vector3.new(51, 1, 49)
  762. o40.CFrame = CFrame.new(0.5, 22.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  763. o40.Color = Color3.new(1, 0, 0)
  764. o40.Position = Vector3.new(0.5, 22.4999962, 4.5)
  765. mas.Parent = workspace
  766. mas:MakeJoints()
  767. local mas1 = mas:GetChildren()
  768. for i=1,#mas1 do
  769. mas1[i].Parent = workspace
  770. ypcall(function() mas1[i]:MakeJoints() end)
  771. end
  772. mas:Destroy()
  773. for i=1,#cors do
  774. coroutine.resume(cors[i])
  775. end
  776. mess_handle.Text = "Resetting"
  777. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  778. v:LoadCharacter()
  779. end
  780. wait(1)
  781. mess_handle:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement