Advertisement
popster12345

Untitled

Feb 20th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. -------- OMG HAX
  2.  
  3. r = game:service("RunService")
  4.  
  5.  
  6. Tool = script.Parent
  7. hammer = Tool.Handle
  8.  
  9. local shockRing = Instance.new("Part")
  10. shockRing.formFactor = 2
  11. shockRing.Size = Vector3.new(1, 0.4, 1)
  12. shockRing.Anchored = true
  13. shockRing.Locked = true
  14. shockRing.CanCollide = false
  15. shockRing.archivable = false
  16. shockRing.TopSurface = 0
  17. shockRing.BottomSurface = 0
  18. shockRing.Transparency = 1
  19. local decal = Instance.new("Decal")
  20. decal.Face = 1
  21. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  22. decal.Parent = shockRing
  23.  
  24. local bottomDecal = decal:Clone()
  25. bottomDecal.Face = 4
  26. bottomDecal.Parent = shockRing
  27.  
  28.  
  29.  
  30. function doDamage(hit)
  31. local humanoid = hit.Parent:findFirstChild("Humanoid")
  32. local vCharacter = Tool.Parent
  33. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  34. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  35. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  36. tagHumanoid(humanoid, vPlayer)
  37. humanoid:TakeDamage(humanoid.MaxHealth)
  38. if humanoid.Health <= 0 then
  39. local c = hit.CFrame
  40. hit.CFrame = CFrame.new(hit.Position)
  41. hit.CFrame = c
  42. end
  43. delay(1, function() untagHumanoid(humanoid) end)
  44. else
  45. local c = hit.CFrame hit:BreakJoints() hit.CFrame = CFrame.new(hit.Position) hit.CFrame = c
  46. end
  47. end
  48.  
  49.  
  50. function tagHumanoid(humanoid, player)
  51. local creator_tag = Instance.new("ObjectValue")
  52. creator_tag.Value = player
  53. creator_tag.Name = "creator"
  54. creator_tag.Parent = humanoid
  55. end
  56.  
  57. function untagHumanoid(humanoid)
  58. if humanoid ~= nil then
  59. local tag = humanoid:findFirstChild("creator")
  60. if tag ~= nil then
  61. tag.Parent = nil
  62. end
  63. end
  64. end
  65.  
  66. function blow(obj, pos, notme)
  67. if (obj ~= notme) then
  68. if (obj.className == "Part") or (obj.className == "Seat") then
  69. 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
  70. 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)
  71. end
  72. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  73. local list = obj:GetChildren()
  74. for x = 1, #list do
  75. blow(list[x], pos, notme)
  76. end
  77. end
  78. end
  79. end
  80.  
  81. function attack()
  82. damage = slash_damage
  83. local anim = Instance.new("StringValue")
  84. anim.Name = "toolanim"
  85. anim.Value = "Slash"
  86. anim.Parent = Tool
  87. wait(0.2)
  88.  
  89. print("Blasting!")
  90.  
  91. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  92.  
  93. blow(workspace, pos, Tool.Parent)
  94.  
  95. shockRing.CFrame = CFrame.new(pos)
  96. for x = 1, 29 do
  97. 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)
  98. end
  99. delay(1, function() shockRing.Parent = nil end)
  100. end
  101.  
  102.  
  103. Tool.Enabled = true
  104. function onActivated()
  105.  
  106. if not Tool.Enabled then
  107. return
  108. end
  109.  
  110. Tool.Enabled = false
  111.  
  112. local character = Tool.Parent;
  113. local humanoid = character.Humanoid
  114. if humanoid == nil then
  115. print("Humanoid not found")
  116. return
  117. end
  118.  
  119. hammer.Boom:Play()
  120. attack()
  121.  
  122. wait(0.5)
  123.  
  124. Tool.Enabled = true
  125. end
  126.  
  127.  
  128. script.Parent.Activated:connect(onActivated)
  129. --script.Parent.Equipped:connect(onEquipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement