Advertisement
Derek1017

Dr Octagonapus

Feb 19th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. ~~~~~~~~~~~~~~~~~~~~
  2. local tox = game.Players["Derek1017"]
  3.  
  4. local t = Instance.new("Tool")
  5. t.Parent = tox.Backpack
  6. t.Name = "BLAAGH!"
  7.  
  8. local h = Instance.new("Part")
  9. h.Name = "Handle"
  10. h.Parent = t
  11. h.Transparency = 1
  12.  
  13. local sound1 = Instance.new("Sound")
  14. sound1.Name = "Swoosh"
  15. sound1.SoundId = "rbxasset://sounds\Rocket whoosh 01.wav"
  16. sound1.Parent = t
  17.  
  18. local sound2 = Instance.new("Sound")
  19. sound2.Name = "Explosion"
  20. sound2.SoundId = "rbxasset://sounds\collide.wav"
  21. sound2.Parent = t
  22.  
  23. local script1 = Instance.new("Script")
  24. script1.Name = "RocketScript"
  25. script1.Source = [[
  26. r = game:service("RunService")
  27.  
  28. shaft = script.Parent
  29. position = shaft.Position
  30.  
  31. script.Parent.Explosion.PlayOnRemove = true -- play explosion sound when projectile removed from game
  32.  
  33. function fly()
  34. direction = shaft.CFrame.lookVector
  35. position = position + direction * 20
  36. error = position - shaft.Position
  37. shaft.Velocity = 7*error
  38. end
  39.  
  40. function blow()
  41. swoosh:stop()
  42. explosion = Instance.new("Explosion")
  43. explosion.Position = shaft.Position
  44. explosion.BlastPressure = 100000
  45. explosion.BlastRadius = 20
  46.  
  47. -- find instigator tag
  48. local creator = script.Parent:findFirstChild("creator")
  49. if creator ~= nil then
  50. explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
  51. end
  52.  
  53. explosion.Parent = game.Workspace
  54. connection:disconnect()
  55. wait(.1)
  56. shaft:remove()
  57. end
  58.  
  59. function onPlayerBlownUp(part, distance, creator)
  60.  
  61. if part.Name == "Head" then
  62.  
  63. local humanoid = part.Parent.Humanoid
  64. tagHumanoid(humanoid, creator)
  65. end
  66. end
  67.  
  68. function tagHumanoid(humanoid, creator)
  69. -- tag does not need to expire iff all explosions lethal
  70.  
  71. if creator ~= nil then
  72. local new_tag = creator:clone()
  73. new_tag.Parent = humanoid
  74.  
  75. end
  76. end
  77.  
  78. function untagHumanoid(humanoid)
  79. if humanoid ~= nil then
  80. local tag = humanoid:findFirstChild("creator")
  81. if tag ~= nil then
  82.  
  83. tag.Parent = nil
  84. end
  85. end
  86. end
  87.  
  88. t, s = r.Stepped:wait()
  89.  
  90. swoosh = script.Parent.Swoosh
  91. swoosh:play()
  92.  
  93. d = t + 10.0 - s
  94. connection = shaft.Touched:connect(blow)
  95.  
  96. while t < d do
  97. fly()
  98. t = r.Stepped:wait()
  99. end
  100.  
  101. -- at max range
  102. script.Parent.Explosion.PlayOnRemove = false
  103. swoosh:stop()
  104. shaft:remove()
  105. ]]
  106. script1.Parent = t
  107.  
  108. local script2 = Instance.new("Script")
  109. script2.Name = "Server Launcher"
  110. script2.Source = [[
  111. local Rocket = Instance.new("Part")
  112. local Sparkle = Instance.new("Sparkles")
  113. local Tool = script.Parent
  114.  
  115. Rocket.Locked = true
  116. Rocket.Size = Vector3.new(1,1,4)
  117. Rocket.Transparency = 1
  118.  
  119. Tool.RocketScript:clone().Parent = Rocket
  120. Tool.Explosion:clone().Parent = Rocket
  121. Tool.Swoosh:clone().Parent = Rocket
  122.  
  123.  
  124. function fire(vTarget)
  125.  
  126. local vCharacter = Tool.Parent;
  127.  
  128. local vHandle = Tool:findFirstChild("Handle")
  129. if vHandle == nil then
  130. print("Handle not found")
  131. return
  132. end
  133.  
  134. local dir = vTarget - vHandle.Position
  135.  
  136. dir = computeDirection(dir)
  137.  
  138. local missile = Rocket:clone()
  139. local spark = Sparkle:clone()
  140.  
  141. local pos = vHandle.Position + (dir * 6)
  142.  
  143. --missile.Position = pos
  144. missile.CFrame = CFrame.new(pos, pos + dir)
  145.  
  146. local creator_tag = Instance.new("ObjectValue")
  147.  
  148. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  149.  
  150. if vPlayer == nil then
  151. print("Player not found")
  152. else
  153. if (vPlayer.Neutral == false) then -- nice touch
  154. missile.BrickColor = vPlayer.TeamColor
  155. end
  156. end
  157.  
  158. creator_tag.Value =vPlayer
  159. creator_tag.Name = "creator"
  160. creator_tag.Parent = missile
  161.  
  162. missile.RocketScript.Disabled = false
  163.  
  164. missile.Parent = game.Workspace
  165. spark.Parent = missile
  166. end
  167.  
  168. function computeDirection(vec)
  169. local lenSquared = vec.magnitude * vec.magnitude
  170. local invSqrt = 1 / math.sqrt(lenSquared)
  171. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  172. end
  173.  
  174. Tool.Enabled = true
  175. function onActivated()
  176. if not Tool.Enabled then
  177. return
  178. end
  179.  
  180. Tool.Enabled = false
  181.  
  182. local character = Tool.Parent;
  183. local humanoid = character.Humanoid
  184. if humanoid == nil then
  185. print("Humanoid not found")
  186. return
  187. end
  188.  
  189. local targetPos = humanoid.TargetPoint
  190. local msg = Instance.new("Hint")
  191. msg.Text = "DR OCTAGONAPUS"
  192. msg.Parent = game.Workspace
  193. wait(0.5)
  194. fire(targetPos)
  195. msg.Text = "DR OCTAGONAPUS BLAAGH"
  196. wait(1.5)
  197. msg:remove()
  198. Tool.Enabled = true
  199. end
  200.  
  201.  
  202. script.Parent.Activated:connect(onActivated)
  203.  
  204. ]]
  205.  
  206. script2.Parent = t
  207.  
  208. local script3 = Instance.new("Script")
  209. script3.Name = "Local Gui"
  210. script3.Source = [[
  211. local Tool = script.Parent;
  212.  
  213. enabled = true
  214. function onButton1Down(mouse)
  215. if not enabled then
  216. return
  217. end
  218.  
  219. enabled = false
  220. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  221.  
  222. wait(7)
  223. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  224. enabled = true
  225.  
  226. end
  227.  
  228. function onEquippedLocal(mouse)
  229.  
  230. if mouse == nil then
  231. print("Mouse not found")
  232. return
  233. end
  234.  
  235. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  236. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  237. end
  238.  
  239.  
  240. Tool.Equipped:connect(onEquippedLocal)
  241. ]]
  242. script.Parent = t
  243.  
  244. tox.Character.Animate:remove()
  245. p = tox.Character.Torso:GetChildren()
  246. local shirt = tox.Character:findFirstChild("Shirt")
  247. if shirt ~= nil then shirt:remove() end
  248. local pants = tox.Character:findFirstChild("Pants")
  249. if pants ~= nil then pants:remove() end
  250. tox.Character.Torso.roblox:remove()
  251. tox.Character.Head.face.Texture = "http://www.roblox.com/asset/?version=1&amp;id=1496869"
  252. h = tox.Character:GetChildren()
  253.  
  254. for i=1, #h do
  255. if h[i].className == "Hat" then
  256. h[i]:remove()
  257. end
  258. end
  259.  
  260. for i = 1, #p do
  261. if p[i].className == "Motor" then
  262. p[i].MaxVelocity = 1
  263. end
  264. end
  265.  
  266.  
  267. while true do
  268. for i=1, #p do
  269. if p[i].className == "Motor" then
  270. p[i].DesiredAngle = 1
  271. end
  272. end
  273. wait()
  274. for i=1, #p do
  275. if p[i].className == "Motor" then
  276. p[i].DesiredAngle = 2
  277. end
  278. end
  279. wait()
  280. for i=1, #p do
  281. if p[i].className == "Motor" then
  282. p[i].DesiredAngle = 3
  283. end
  284. end
  285. wait()
  286. for i=1, #p do
  287. if p[i].className == "Motor" then
  288. p[i].DesiredAngle = 4
  289. end
  290. end
  291. wait()
  292. for i=1, #p do
  293. if p[i].className == "Motor" then
  294. p[i].DesiredAngle = 3
  295. end
  296. end
  297. wait()
  298. for i=1, #p do
  299. if p[i].className == "Motor" then
  300. p[i].DesiredAngle = 2
  301. end
  302. end
  303. wait()
  304. for i=1, #p do
  305. if p[i].className == "Motor" then
  306. p[i].DesiredAngle = 1
  307. end
  308. end
  309. wait()
  310. for i=1, #p do
  311. if p[i].className == "Motor" then
  312. p[i].DesiredAngle = 0
  313. end
  314. end
  315. wait()
  316. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement