Advertisement
djroese

Untitled

Sep 1st, 2017
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. LocalScript1 = Instance.new("LocalScript")
  21. Part2 = Instance.new("Part")
  22. SpecialMesh3 = Instance.new("SpecialMesh")
  23. Sound4 = Instance.new("Sound")
  24. Script5 = Instance.new("Script")
  25. Tool0.Name = "Mjolnir"
  26. Tool0.Parent = mas
  27. Tool0.TextureId = "http://www.roblox.com/asset/?version=1&id=1280038"
  28. Tool0.GripPos = Vector3.new(0, -1.29999995, 0)
  29. LocalScript1.Name = "Local Gui"
  30. LocalScript1.Parent = Tool0
  31. Part2.Name = "Handle"
  32. Part2.Parent = Tool0
  33. Part2.BrickColor = BrickColor.new("Dark stone grey")
  34. Part2.Rotation = Vector3.new(0, -90, 0)
  35. Part2.FormFactor = Enum.FormFactor.Symmetric
  36. Part2.Size = Vector3.new(1, 4, 2)
  37. Part2.CFrame = CFrame.new(0, 2.00000501, -5, -1.48439261e-08, 5.19905403e-11, -1, 3.04304325e-12, 1, -5.19905403e-11, 1, 3.04304325e-12, 1.48439261e-08)
  38. Part2.BottomSurface = Enum.SurfaceType.Smooth
  39. Part2.TopSurface = Enum.SurfaceType.Smooth
  40. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  41. Part2.Position = Vector3.new(0, 2.00000501, -5)
  42. Part2.Orientation = Vector3.new(0, -90, 0)
  43. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  44. SpecialMesh3.Parent = Part2
  45. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=1279013"
  46. SpecialMesh3.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
  47. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=1279012"
  48. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  49. SpecialMesh3.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
  50. Sound4.Name = "Boom"
  51. Sound4.Parent = Part2
  52. Sound4.SoundId = "rbxasset://sounds/Rocket shot.wav"
  53. Sound4.Volume = 1
  54. Script5.Name = "HammerScript"
  55. Script5.Parent = Tool0
  56. table.insert(cors,sandbox(Script5,function()
  57. -------- OMG HAX
  58.  
  59. r = game:service("RunService")
  60.  
  61.  
  62. Tool = script.Parent
  63. hammer = Tool.Handle
  64.  
  65. local shockRing = Instance.new("Part")
  66. shockRing.formFactor = 2
  67. shockRing.Size = Vector3.new(1, 0.4, 1)
  68. shockRing.Anchored = true
  69. shockRing.Locked = true
  70. shockRing.CanCollide = false
  71. shockRing.archivable = false
  72. shockRing.TopSurface = 0
  73. shockRing.BottomSurface = 0
  74. shockRing.Transparency = 1
  75. local decal = Instance.new("Decal")
  76. decal.Face = 1
  77. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  78. decal.Parent = shockRing
  79.  
  80. local bottomDecal = decal:Clone()
  81. bottomDecal.Face = 4
  82. bottomDecal.Parent = shockRing
  83.  
  84.  
  85.  
  86. function doDamage(hit)
  87. local humanoid = hit.Parent:findFirstChild("Humanoid")
  88. local vCharacter = Tool.Parent
  89. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  90. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  91. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  92. tagHumanoid(humanoid, vPlayer)
  93. humanoid:TakeDamage(humanoid.MaxHealth)
  94. if humanoid.Health <= 0 then
  95. local c = hit.CFrame
  96. hit.CFrame = CFrame.new(hit.Position)
  97. hit.CFrame = c
  98. end
  99. delay(1, function() untagHumanoid(humanoid) end)
  100. else
  101. local c = hit.CFrame hit:BreakJoints() hit.CFrame = CFrame.new(hit.Position) hit.CFrame = c
  102. end
  103. end
  104.  
  105.  
  106. function tagHumanoid(humanoid, player)
  107. local creator_tag = Instance.new("ObjectValue")
  108. creator_tag.Value = player
  109. creator_tag.Name = "creator"
  110. creator_tag.Parent = humanoid
  111. end
  112.  
  113. function untagHumanoid(humanoid)
  114. if humanoid ~= nil then
  115. local tag = humanoid:findFirstChild("creator")
  116. if tag ~= nil then
  117. tag.Parent = nil
  118. end
  119. end
  120. end
  121.  
  122. function blow(obj, pos, notme)
  123. if (obj ~= notme) then
  124. if (obj.className == "Part") or (obj.className == "Seat") then
  125. if (not obj.Anchored) and (((pos - obj.Position) * Vector3.new(1, 0, 1)).magnitude < 96) and (pos.y <= obj.Position.y + 8) and (pos.y >= obj.Position.y - 8) then
  126. delay((pos - obj.Position).magnitude / 96, function() doDamage(obj) obj.Velocity = ((obj.Position - pos).unit + Vector3.new(0, 0.5, 0)) * 96 + obj.Velocity obj.RotVelocity = obj.RotVelocity + Vector3.new(obj.Position.z - pos.z, 0, pos.x - obj.Position.x).unit * 40 end)
  127. end
  128. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  129. local list = obj:GetChildren()
  130. for x = 1, #list do
  131. blow(list[x], pos, notme)
  132. end
  133. end
  134. end
  135. end
  136.  
  137. function attack()
  138. damage = slash_damage
  139. local anim = Instance.new("StringValue")
  140. anim.Name = "toolanim"
  141. anim.Value = "Slash"
  142. anim.Parent = Tool
  143. wait(0.2)
  144.  
  145. print("Blasting!")
  146.  
  147. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  148.  
  149. blow(workspace, pos, Tool.Parent)
  150.  
  151. shockRing.CFrame = CFrame.new(pos)
  152. for x = 1, 29 do
  153. delay(x / 30, function() shockRing.Parent = nil shockRing.Size = Vector3.new(0, 0.4, 0) + Vector3.new(6.4, 0, 6.4) * x shockRing.Parent = Tool end)
  154. end
  155. delay(1, function() shockRing.Parent = nil end)
  156. end
  157.  
  158.  
  159. Tool.Enabled = true
  160. function onActivated()
  161.  
  162. if not Tool.Enabled then
  163. return
  164. end
  165.  
  166. Tool.Enabled = false
  167.  
  168. local character = Tool.Parent;
  169. local humanoid = character.Humanoid
  170. if humanoid == nil then
  171. print("Humanoid not found")
  172. return
  173. end
  174.  
  175. hammer.Boom:Play()
  176. attack()
  177.  
  178. wait(0.5)
  179.  
  180. Tool.Enabled = true
  181. end
  182.  
  183.  
  184. script.Parent.Activated:connect(onActivated)
  185. --script.Parent.Equipped:connect(onEquipped)
  186. end))
  187. for i,v in pairs(mas:GetChildren()) do
  188. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  189. pcall(function() v:MakeJoints() end)
  190. end
  191. mas:Destroy()
  192. for i,v in pairs(cors) do
  193. spawn(function()
  194. pcall(v)
  195. end)
  196. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement