Advertisement
ttyyuu12345

Thor's Hammer

Jul 28th, 2016
3,476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 KB | None | 0 0
  1. --Created with ttyyuu12345's compiler
  2. --ttyyuu12345 is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --ttyyuu12345 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, however I do accept donations
  8. --Errors: TouchTransmitter
  9. Tool = Instance.new("Tool",game.Lighting)
  10. Create = function(itemClass,tabl)
  11. local item = Instance.new(itemClass)
  12. for i,v in pairs(tabl) do
  13. local a,b = ypcall(function() return item[i] end)
  14. if a then
  15. item[i] = tabl[i]
  16. end
  17. end
  18. return item
  19. end
  20. function runDummyScript(f,scri)
  21. local oldenv = getfenv(f)
  22. local newenv = setmetatable({}, {
  23. __index = function(_, k)
  24. if k:lower() == 'script' then
  25. return scri
  26. else
  27. return oldenv[k]
  28. end
  29. end
  30. })
  31. setfenv(f, newenv)
  32. ypcall(function() f() end)
  33. end
  34. cors = {}
  35. mas = Instance.new("Model",game:GetService("Lighting"))
  36. mas.Name = "CompiledModel"
  37. o1 = Create("LocalScript",{
  38. ["Name"] = "HammerScript",
  39. ["Parent"] = mas,
  40. })
  41. table.insert(cors,coroutine.create(function()
  42. wait()
  43. runDummyScript(function()
  44. -------- OMG HAX
  45.  
  46. r = game:service("RunService")
  47.  
  48.  
  49. Tool = script.Parent
  50. hammer = Tool.Handle
  51.  
  52. local shockRing = Instance.new("Part")
  53. shockRing.formFactor = 2
  54. shockRing.Size = Vector3.new(1, 0.4, 1)
  55. shockRing.Anchored = true
  56. shockRing.Locked = true
  57. shockRing.CanCollide = false
  58. shockRing.archivable = false
  59. shockRing.TopSurface = 0
  60. shockRing.BottomSurface = 0
  61. shockRing.Transparency = 1
  62. local decal = Instance.new("Decal")
  63. decal.Face = 1
  64. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  65. decal.Parent = shockRing
  66.  
  67. local bottomDecal = decal:Clone()
  68. bottomDecal.Face = 4
  69. bottomDecal.Parent = shockRing
  70.  
  71.  
  72.  
  73. function doDamage(hit)
  74. if hit.Locked==false then
  75. hit:Remove()
  76. end
  77. end
  78.  
  79.  
  80. function tagHumanoid(humanoid, player)
  81. local creator_tag = Instance.new("ObjectValue")
  82. creator_tag.Value = player
  83. creator_tag.Name = "creator"
  84. creator_tag.Parent = humanoid
  85. end
  86.  
  87. function untagHumanoid(humanoid)
  88. if humanoid ~= nil then
  89. local tag = humanoid:findFirstChild("creator")
  90. if tag ~= nil then
  91. tag.Parent = nil
  92. end
  93. end
  94. end
  95.  
  96. function blow(obj, pos, notme)
  97. if (obj ~= notme) then
  98. if (obj.className == "Part") or (obj.className == "Seat") then
  99. 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
  100. 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)
  101. end
  102. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  103. local list = obj:GetChildren()
  104. for x = 1, #list do
  105. blow(list[x], pos, notme)
  106. end
  107. end
  108. end
  109. end
  110.  
  111. function attack()
  112. damage = slash_damage
  113. local anim = Instance.new("StringValue")
  114. anim.Name = "toolanim"
  115. anim.Value = "Slash"
  116. anim.Parent = Tool
  117. wait(0.2)
  118.  
  119. print("Blasting!")
  120.  
  121. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  122.  
  123. blow(workspace, pos, Tool.Parent)
  124.  
  125. shockRing.CFrame = CFrame.new(pos)
  126. for x = 1, 29 do
  127. 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)
  128. end
  129. delay(1, function() shockRing.Parent = nil end)
  130. end
  131.  
  132.  
  133. Tool.Enabled = true
  134. function onActivated()
  135.  
  136. if not Tool.Enabled then
  137. return
  138. end
  139.  
  140. Tool.Enabled = false
  141.  
  142. local character = Tool.Parent;
  143. local humanoid = character.Humanoid
  144. if humanoid == nil then
  145. print("Humanoid not found")
  146. return
  147. end
  148.  
  149. hammer.Boom:Play()
  150. attack()
  151.  
  152. wait(0.5)
  153.  
  154. Tool.Enabled = true
  155. end
  156.  
  157.  
  158. script.Parent.Activated:connect(onActivated)
  159. --script.Parent.Equipped:connect(onEquipped)
  160. end,o1)
  161. end))
  162. o2 = Create("LocalScript",{
  163. ["Name"] = "Local Gui",
  164. ["Parent"] = mas,
  165. })
  166. table.insert(cors,coroutine.create(function()
  167. wait()
  168. runDummyScript(function()
  169. --rbxsig%aoxvdm1aPjaZNWfciK/Pr0xTiQSMTYPK6DeYzUBftM3ktWksFxD/qPfCrisawJWUgizm/pahcvio8hGdfVGRiDrzgV+Eu4mePmGNQTrNP1WKW+gHElJt9nBVEWptENhA5JCXALEN65aM6HLKdEaWvEOtAKhSF2Y2nJcuyixzj58=%
  170. --rbxassetid%1014476%
  171. local Tool = script.Parent;
  172.  
  173. enabled = true
  174. function onButton1Down(mouse)
  175. if not enabled then
  176. return
  177. end
  178.  
  179. enabled = false
  180. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  181.  
  182. wait(.5)
  183. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  184. enabled = true
  185.  
  186. end
  187.  
  188. function onEquippedLocal(mouse)
  189.  
  190. if mouse == nil then
  191. print("Mouse not found")
  192. return
  193. end
  194.  
  195. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  196. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  197. end
  198.  
  199.  
  200. Tool.Equipped:connect(onEquippedLocal)
  201.  
  202. end,o2)
  203. end))
  204. o3 = Create("Part",{
  205. ["Name"] = "Handle",
  206. ["Parent"] = mas,
  207. ["BrickColor"] = BrickColor.new("Dark stone grey"),
  208. ["Position"] = Vector3.new(-8.5, 2, -19),
  209. ["CFrame"] = CFrame.new(-8.5, 2, -19, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  210. ["FormFactor"] = Enum.FormFactor.Symmetric,
  211. ["Size"] = Vector3.new(1, 4, 2),
  212. ["BottomSurface"] = Enum.SurfaceType.Smooth,
  213. ["TopSurface"] = Enum.SurfaceType.Smooth,
  214. ["Color"] = Color3.new(0.388235, 0.372549, 0.384314),
  215. })
  216. o4 = Create("SpecialMesh",{
  217. ["Parent"] = o3,
  218. ["MeshId"] = "http://www.roblox.com/asset/?id=1279013",
  219. ["Scale"] = Vector3.new(1.04999995, 1.04999995, 1.04999995),
  220. ["TextureId"] = "http://www.roblox.com/asset/?id=1279012",
  221. ["MeshType"] = Enum.MeshType.FileMesh,
  222. })
  223. o5 = Create("Sound",{
  224. ["Name"] = "Boom",
  225. ["Parent"] = o3,
  226. ["SoundId"] = "rbxasset://sounds/Rocket shot.wav",
  227. ["Volume"] = 1,
  228. })
  229. mas.Parent = workspace
  230. mas:MakeJoints()
  231. local mas1 = mas:GetChildren()
  232. for i=1,#mas1 do
  233. mas1[i].Parent = Tool
  234. ypcall(function() mas1[i]:MakeJoints() end)
  235. end
  236. mas:Destroy()
  237. Tool.Parent = game.Players.LocalPlayer.Character
  238. script.Parent = Tool
  239. for i=1,#cors do
  240. coroutine.resume(cors[i])
  241. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement