hawoody

Ban Hammer

Apr 21st, 2018
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.85 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. Tool0 = Instance.new("Tool")
  19. Part1 = Instance.new("Part")
  20. Sound2 = Instance.new("Sound")
  21. SpecialMesh3 = Instance.new("SpecialMesh")
  22. ParticleEmitter4 = Instance.new("ParticleEmitter")
  23. PointLight5 = Instance.new("PointLight")
  24. Script6 = Instance.new("Script")
  25. LocalScript7 = Instance.new("LocalScript")
  26. Script8 = Instance.new("Script")
  27. PointLight9 = Instance.new("PointLight")
  28. Tool0.Name = "BanHammer"
  29. Tool0.Parent = mas
  30. Tool0.GripPos = Vector3.new(0, -1, 0)
  31. Part1.Name = "Handle"
  32. Part1.Parent = Tool0
  33. Part1.Rotation = Vector3.new(90.0199966, 0, 66.4599991)
  34. Part1.RotVelocity = Vector3.new(-0.00235919608, 0.000430068758, 0.00397496484)
  35. Part1.Velocity = Vector3.new(0.00131022232, -0.00751958555, 0.00376307126)
  36. Part1.Size = Vector3.new(1, 4.80000019, 1)
  37. Part1.CFrame = CFrame.new(32.008461, 0.891610622, -25.8348217, 0.39936024, -0.916794062, -5.90707568e-05, -0.00029530219, -6.41899824e-05, -0.99999994, 0.916794002, 0.39936021, -0.000296359474)
  38. Part1.Position = Vector3.new(32.008461, 0.891610622, -25.8348217)
  39. Part1.Orientation = Vector3.new(89.9799957, -168.729996, -102.259995)
  40. Sound2.Name = "Boom"
  41. Sound2.Parent = Part1
  42. Sound2.SoundId = "rbxasset://sounds/Rocket shot.wav"
  43. Sound2.Volume = 1
  44. SpecialMesh3.Parent = Part1
  45. SpecialMesh3.MeshId = "rbxassetid://10604848"
  46. SpecialMesh3.TextureId = "rbxassetid://94840359"
  47. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  48. ParticleEmitter4.Parent = Part1
  49. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  50. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  51. PointLight5.Parent = Part1
  52. PointLight5.Color = Color3.new(1, 0, 0.0156863)
  53. PointLight5.Brightness = 9.9999998430675e+17
  54. PointLight5.Range = 60
  55. PointLight5.Color = Color3.new(1, 0, 0.0156863)
  56. Script6.Name = "HammerScript"
  57. Script6.Parent = Tool0
  58. table.insert(cors,sandbox(Script6,function()
  59. -------- OMG HAX
  60.  
  61. r = game:service("RunService")
  62.  
  63.  
  64. Tool = script.Parent
  65. hammer = Tool.Handle
  66.  
  67. local shockRing = Instance.new("Part")
  68. shockRing.formFactor = 2
  69. shockRing.Size = Vector3.new(1, 0.60, 999999)
  70. shockRing.Anchored = true
  71. shockRing.Locked = true
  72. shockRing.CanCollide = false
  73. shockRing.archivable = false
  74. shockRing.TopSurface = 0
  75. shockRing.BottomSurface = 0
  76. shockRing.Transparency = 1
  77. local decal = Instance.new("Decal")
  78. decal.Face = 1
  79. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  80. decal.Parent = shockRing
  81.  
  82. local bottomDecal = decal:Clone()
  83. bottomDecal.Face = 4
  84. bottomDecal.Parent = shockRing
  85.  
  86.  
  87.  
  88. function doDamage(hit)
  89. local humanoid = hit.Parent:findFirstChild("Humanoid")
  90. local vCharacter = Tool.Parent
  91. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  92. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  93. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  94. tagHumanoid(humanoid, vPlayer)
  95. humanoid:TakeDamage(humanoid.MaxHealth)
  96. if humanoid.Health <= 0 then
  97. local c = hit.CFrame
  98. hit.CFrame = CFrame.new(hit.Position)
  99. hit.CFrame = c
  100. end
  101. delay(1, function() untagHumanoid(humanoid) end)
  102. else
  103. local c = hit.CFrame hit:BreakJoints() hit.CFrame = CFrame.new(hit.Position) hit.CFrame = c
  104. end
  105. end
  106.  
  107.  
  108. function tagHumanoid(humanoid, player)
  109. local creator_tag = Instance.new("ObjectValue")
  110. creator_tag.Value = player
  111. creator_tag.Name = "creator"
  112. creator_tag.Parent = humanoid
  113. end
  114.  
  115. function untagHumanoid(humanoid)
  116. if humanoid ~= nil then
  117. local tag = humanoid:findFirstChild("creator")
  118. if tag ~= nil then
  119. tag.Parent = nil
  120. end
  121. end
  122. end
  123.  
  124. function blow(obj, pos, notme)
  125. if (obj ~= notme) then
  126. if (obj.className == "Part") or (obj.className == "Seat") then
  127. 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
  128. 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)
  129. end
  130. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  131. local list = obj:GetChildren()
  132. for x = 1, #list do
  133. blow(list[x], pos, notme)
  134. end
  135. end
  136. end
  137. end
  138.  
  139. function attack()
  140. damage = slash_damage
  141. local anim = Instance.new("StringValue")
  142. anim.Name = "toolanim"
  143. anim.Value = "Slash"
  144. anim.Parent = Tool
  145. wait(0.2)
  146.  
  147. print("Blasting!")
  148.  
  149. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  150.  
  151. blow(workspace, pos, Tool.Parent)
  152.  
  153. shockRing.CFrame = CFrame.new(pos)
  154. for x = 1, 29 do
  155. 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)
  156. end
  157. delay(1, function() shockRing.Parent = nil end)
  158. end
  159.  
  160.  
  161. Tool.Enabled = true
  162. function onActivated()
  163.  
  164. if not Tool.Enabled then
  165. return
  166. end
  167.  
  168. Tool.Enabled = false
  169.  
  170. local character = Tool.Parent;
  171. local humanoid = character.Humanoid
  172. if humanoid == nil then
  173. print("Humanoid not found")
  174. return
  175. end
  176.  
  177. hammer.Boom:Play()
  178. attack()
  179.  
  180. wait(0.5)
  181.  
  182. Tool.Enabled = true
  183. end
  184.  
  185.  
  186. script.Parent.Activated:connect(onActivated)
  187. --script.Parent.Equipped:connect(onEquipped)
  188. end))
  189. LocalScript7.Name = "Local Gui"
  190. LocalScript7.Parent = Tool0
  191. Script8.Name = "PUT THIS IN THE WEAPON"
  192. Script8.Parent = Tool0
  193. table.insert(cors,sandbox(Script8,function()
  194. local debounce = false
  195.  
  196. function getPlayer(humanoid)
  197. local players = game.Players:children()
  198. for i = 1, #players do
  199. if players[i].Character.Humanoid == humanoid then return players[i] end
  200. end
  201. return nil
  202. end
  203.  
  204. function onTouch(part)
  205.  
  206. local human = part.Parent:findFirstChild("Humanoid")
  207. if (human ~= nil) and debounce == false then
  208.  
  209. debounce = true
  210.  
  211. local player = getPlayer(human)
  212.  
  213. if (player == nil) then return end
  214.  
  215. script.Parent:clone().Parent = player.Backpack
  216.  
  217. wait(2)
  218. debounce = false
  219. end
  220. end
  221.  
  222.  
  223. script.Parent.Parent.Touched:connect(onTouch)
  224.  
  225. end))
  226. PointLight9.Parent = Tool0
  227. PointLight9.Color = Color3.new(0.666667, 0, 1)
  228. PointLight9.Brightness = 9.9999996802857e+37
  229. PointLight9.Range = 60
  230. PointLight9.Color = Color3.new(0.666667, 0, 1)
  231. for i,v in pairs(mas:GetChildren()) do
  232. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  233. pcall(function() v:MakeJoints() end)
  234. end
  235. mas:Destroy()
  236. for i,v in pairs(cors) do
  237. spawn(function()
  238. pcall(v)
  239. end)
  240. end
Add Comment
Please, Sign In to add comment