hawoody

Amaterasu

Apr 15th, 2018
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 KB | None | 0 0
  1. --Converted with ttyyuu12345's model to script plugin v4
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Script0 = Instance.new("Script")
  19. HopperBin1 = Instance.new("HopperBin")
  20. Part2 = Instance.new("Part")
  21. Script3 = Instance.new("Script")
  22. Sound4 = Instance.new("Sound")
  23. Sound5 = Instance.new("Sound")
  24. Script6 = Instance.new("Script")
  25. Script7 = Instance.new("Script")
  26. SpecialMesh8 = Instance.new("SpecialMesh")
  27. Script9 = Instance.new("Script")
  28. Script0.Name = "RocketScript"
  29. Script0.Parent = mas
  30. Script0.Disabled = true
  31. table.insert(cors,sandbox(Script0,function()
  32. r = game:service("RunService")
  33.  
  34. shaft = script.Parent
  35. position = shaft.Position
  36.  
  37. function fly()
  38. direction = shaft.CFrame.lookVector
  39. position = position + (direction*2)
  40. error = position - shaft.Position
  41. shaft.Velocity = error * 10
  42. end
  43.  
  44. function blow()
  45. --swoosh:stop()
  46. explosion = Instance.new("Explosion")
  47. explosion.Position = shaft.Position
  48. explosion.Parent = game.Workspace
  49. connection:disconnect()
  50. wait(.5)
  51. shaft:remove()
  52. end
  53.  
  54. function onPlayerBlownUp(part, distance, creator)
  55.  
  56. if part.Name == "Head" then
  57.  
  58. local humanoid = part.Parent:findFirstChild("Humanoid")
  59. tagHumanoid(humanoid, creator)
  60. end
  61. end
  62.  
  63. function tagHumanoid(humanoid, creator)
  64. -- tag does not need to expire iff all explosions lethal
  65.  
  66. if creator ~= nil then
  67. local new_tag = creator:clone()
  68. new_tag.Parent = humanoid
  69.  
  70. end
  71. end
  72.  
  73. function untagHumanoid(humanoid)
  74. if humanoid ~= nil then
  75. local tag = humanoid:findFirstChild("creator")
  76. if tag ~= nil then
  77.  
  78. tag.Parent = nil
  79. end
  80. end
  81. end
  82.  
  83. t, s = r.Stepped:wait()
  84.  
  85. --swoosh = script.Parent.Swoosh
  86. --swoosh:play()
  87.  
  88. d = t + 10.0 - s
  89.  
  90. while t < d do
  91. fly()
  92. t = r.Stepped:wait()
  93. end
  94.  
  95. script.Parent.Explosion.PlayOnRemove = false
  96. --swoosh:stop()
  97. shaft:remove()
  98.  
  99. end))
  100. HopperBin1.Name = "Amaterasu"
  101. HopperBin1.Parent = mas
  102. HopperBin1.Active = true
  103. Part2.Name = "Rocket"
  104. Part2.Parent = HopperBin1
  105. Part2.BrickColor = BrickColor.new("Black")
  106. Part2.Transparency = 0.30000001192093
  107. Part2.Rotation = Vector3.new(180, 0, -180)
  108. Part2.Anchored = true
  109. Part2.FormFactor = Enum.FormFactor.Symmetric
  110. Part2.Shape = Enum.PartType.Ball
  111. Part2.Size = Vector3.new(4, 4, 4)
  112. Part2.CFrame = CFrame.new(69, 3.20000005, 40, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  113. Part2.BottomSurface = Enum.SurfaceType.Smooth
  114. Part2.TopSurface = Enum.SurfaceType.Smooth
  115. Part2.Color = Color3.new(0.105882, 0.164706, 0.207843)
  116. Part2.Position = Vector3.new(69, 3.20000005, 40)
  117. Part2.Orientation = Vector3.new(0, -180, 0)
  118. Part2.Color = Color3.new(0.105882, 0.164706, 0.207843)
  119. Script3.Name = "RocketScript"
  120. Script3.Parent = Part2
  121. Script3.Disabled = true
  122. table.insert(cors,sandbox(Script3,function()
  123. r = game:service("RunService")
  124.  
  125. shaft = script.Parent
  126. position = shaft.Position
  127.  
  128. function fly()
  129. direction = shaft.CFrame.lookVector
  130. position = position + (direction*2)
  131. error = position - shaft.Position
  132. shaft.Velocity = error * 10
  133. end
  134.  
  135. function blow()
  136. --swoosh:stop()
  137. explosion = Instance.new("Explosion")
  138. explosion.Position = shaft.Position
  139. explosion.Parent = game.Workspace
  140. connection:disconnect()
  141. wait(.5)
  142. shaft:remove()
  143. end
  144.  
  145. function onPlayerBlownUp(part, distance, creator)
  146.  
  147. if part.Name == "Head" then
  148.  
  149. local humanoid = part.Parent:findFirstChild("Humanoid")
  150. tagHumanoid(humanoid, creator)
  151. end
  152. end
  153.  
  154. function tagHumanoid(humanoid, creator)
  155. -- tag does not need to expire iff all explosions lethal
  156.  
  157. if creator ~= nil then
  158. local new_tag = creator:clone()
  159. new_tag.Parent = humanoid
  160.  
  161. end
  162. end
  163.  
  164. function untagHumanoid(humanoid)
  165. if humanoid ~= nil then
  166. local tag = humanoid:findFirstChild("creator")
  167. if tag ~= nil then
  168.  
  169. tag.Parent = nil
  170. end
  171. end
  172. end
  173.  
  174. t, s = r.Stepped:wait()
  175.  
  176. --swoosh = script.Parent.Swoosh
  177. --swoosh:play()
  178.  
  179. d = t + 10.0 - s
  180.  
  181. while t < d do
  182. fly()
  183. t = r.Stepped:wait()
  184. end
  185.  
  186. script.Parent.Explosion.PlayOnRemove = false
  187. --swoosh:stop()
  188. shaft:remove()
  189.  
  190. end))
  191. Sound4.Name = "Explosion"
  192. Sound4.Parent = Part2
  193. Sound4.SoundId = "rbxasset://sounds/collide.wav"
  194. Sound4.Volume = 1
  195. Sound4.PlayOnRemove = true
  196. Sound5.Name = "Swoosh"
  197. Sound5.Parent = Part2
  198. Sound5.SoundId = "http://www.roblox.com/asset/?id=12222095"
  199. Sound5.Volume = 0.69999998807907
  200. Sound5.Looped = true
  201. Script6.Parent = Part2
  202. table.insert(cors,sandbox(Script6,function()
  203. function stick(x, y)
  204.  
  205. weld = Instance.new("Weld")
  206.  
  207.  
  208.  
  209. weld.Part0 = x
  210.  
  211. weld.Part1 = y
  212.  
  213.  
  214.  
  215. local HitPos = x.Position
  216.  
  217.  
  218.  
  219. local CJ = CFrame.new(HitPos)
  220.  
  221. local C0 = x.CFrame:inverse() *CJ
  222.  
  223. local C1 = y.CFrame:inverse() * CJ
  224.  
  225.  
  226.  
  227. weld.C0 = C0
  228.  
  229. weld.C1 = C1
  230.  
  231.  
  232.  
  233. weld.Parent = x
  234.  
  235. end
  236.  
  237.  
  238.  
  239. function onTouched(part)
  240.  
  241. local h = part.Parent:findFirstChild("Humanoid")
  242.  
  243. if h~=nil then
  244.  
  245. wait(0.001)
  246. h.Health = 0
  247. children = h.Parent:children()
  248.  
  249. for i=1,#children do
  250.  
  251. if(children[i].className == "Part" and children[i].Name ~= "Torso") then stick(children[i], h.Parent.Torso) end
  252.  
  253. if(children[i].className == "Hat") then stick(children[i].Handle, h.Parent.Torso) end
  254.  
  255. end
  256.  
  257. h.Parent.Head.Velocity = h.Parent.Head.Velocity + Vector3.new(5,0,0)
  258.  
  259. end
  260.  
  261. end
  262.  
  263.  
  264.  
  265. script.Parent.Touched:connect(onTouched)
  266. end))
  267. Script7.Parent = Part2
  268. table.insert(cors,sandbox(Script7,function()
  269. bin = script.Parent
  270.  
  271. function onTouched()
  272. local n = part.Parent:findFirstChild("Humanoid")
  273. if n ~= nil then
  274. part.BrickColor = BrickColor.new(26)
  275. wait(.3)
  276. part.Transparency = .2
  277. wait(.1)
  278. part.Transparency = .4
  279. wait(.1)
  280. part.Transparency = .6
  281. wait(.1)
  282. part.Transparency = .8
  283. wait(.1)
  284. part.Parent = nil
  285.  
  286. end
  287. end
  288.  
  289. connection = bin.Touched:connect(onTouched)
  290.  
  291. end))
  292. SpecialMesh8.Parent = Part2
  293. SpecialMesh8.MeshId = "http://www.roblox.com/Asset/?id=25212400"
  294. SpecialMesh8.Scale = Vector3.new(4, 4, 4)
  295. SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=22153324"
  296. SpecialMesh8.VertexColor = Vector3.new(2, 1.5, 0.300000012)
  297. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  298. SpecialMesh8.Scale = Vector3.new(4, 4, 4)
  299. Script9.Name = "Launcher"
  300. Script9.Parent = HopperBin1
  301. table.insert(cors,sandbox(Script9,function()
  302. print("New rocket script loaded")
  303.  
  304. bin = script.Parent
  305.  
  306. function fire(target)
  307.  
  308. local head = game.Players.LocalPlayer.Character:findFirstChild("Head")
  309. if head == nil then return end
  310.  
  311. local dir = target - head.Position
  312. dir = computeDirection(dir)
  313.  
  314. print("DIR X:", dir.x, "Y:", dir.y, "z:", dir.z)
  315.  
  316. local missile = bin.Rocket:clone()
  317.  
  318. local spawnPos = game.Players.LocalPlayer.Character.PrimaryPart.Position
  319.  
  320. local pos = spawnPos + (dir * 9)
  321.  
  322. --missile.Position = pos
  323. missile.CFrame = CFrame.new(pos, pos + dir)
  324.  
  325. local creator_tag = Instance.new("ObjectValue")
  326. creator_tag.Value = game.Players.LocalPlayer
  327. creator_tag.Name = "creator"
  328. creator_tag.Parent = missile
  329.  
  330. missile.RocketScript.Disabled = false
  331.  
  332. missile.Parent = game.Workspace
  333.  
  334. end
  335.  
  336. function computeDirection(vec)
  337. local lenSquared = vec.magnitude * vec.magnitude
  338. local invSqrt = 1 / math.sqrt(lenSquared)
  339. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  340. end
  341.  
  342. enabled = true
  343. function onButton1Down(mouse)
  344. if not enabled then
  345. return
  346. end
  347.  
  348. enabled = false
  349. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  350.  
  351. -- find the best cf
  352. local cf = mouse.Hit
  353. --local v = cf.lookVector
  354. local target = cf.p
  355.  
  356. fire(target)
  357.  
  358. wait(1)
  359. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  360. enabled = true
  361.  
  362. end
  363.  
  364. function onSelected(mouse)
  365. print("rocket selected")
  366. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  367. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  368. end
  369.  
  370. bin.Selected:connect(onSelected)
  371. end))
  372. for i,v in pairs(mas:GetChildren()) do
  373. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  374. pcall(function() v:MakeJoints() end)
  375. end
  376. mas:Destroy()
  377. for i,v in pairs(cors) do
  378. spawn(function()
  379. pcall(v)
  380. end)
  381. end
Add Comment
Please, Sign In to add comment