lafur

Untitled

Jan 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. local bh = Instance.new("Tool", game.Players.timetodie23232223.Backpack)--no
  2. bh.Name = "BanHammer"
  3. bh.TextureId = "http://www.roblox.com/asset/?id=10684453"
  4. local han = Instance.new("Part", bh)
  5. han.Name = "Handle"
  6. han.Size = Vector3.new(1,6,1)
  7. local hanm = Instance.new("SpecialMesh", han)
  8. hanm.MeshType = "FileMesh"
  9. hanm.MeshId = "http://www.roblox.com/asset/?id=10604848"
  10. hanm.Scale = Vector3.new(0.8,0.8,0.8)
  11. hanm.TextureId = "http://www.roblox.com/asset/?id=10605252"
  12. local hand = Instance.new("Decal", han)
  13. hand.Texture = "http://www.roblox.com/asset/?id=10605252"
  14. hand.Face = "Back"
  15. local banned = {"The guys who touch the ban hammer","lol"}
  16.  
  17. for i=1, #banned do
  18. game.Players.PlayerAdded:connect(function(p)
  19. if p.Name == banned[i] then
  20. p:Destroy()
  21. end
  22. end)
  23. end
  24.  
  25. han.Touched:connect(function(h)
  26. local plr = game.Players:FindFirstChild(h.Parent.Name)
  27. if plr == nil then
  28. print("Did not find person to ban with ban hammer")
  29. else
  30. plr:Destroy()
  31. table.insert(plr, banned)
  32. end
  33. end)
  34. -------- OMG HAX
  35.  
  36. r = game:service("RunService")
  37.  
  38.  
  39. local damage = 0
  40.  
  41.  
  42. local slash_damage = 0
  43.  
  44.  
  45. sword = han
  46. Tool = bh
  47.  
  48.  
  49. local SlashSound = Instance.new("Sound")
  50. SlashSound.SoundId = "http://www.roblox.com/asset/?id="
  51. SlashSound.Parent = sword
  52. SlashSound.Volume = 1
  53.  
  54.  
  55. local UnsheathSound = Instance.new("Sound")
  56. UnsheathSound.SoundId = "rbxasset://sounds\\jghj.wav"
  57. UnsheathSound.Parent = sword
  58. UnsheathSound.Volume = 1
  59.  
  60.  
  61. function blow(hit)
  62. local humanoid = hit.Parent:findFirstChild("Humanoid")
  63. local vCharacter = Tool.Parent
  64. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  65. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  66. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  67. -- final check, make sure sword is in-hand
  68.  
  69. local right_arm = vCharacter:FindFirstChild("Right Arm")
  70. if (right_arm ~= nil) then
  71. local joint = right_arm:FindFirstChild("RightGrip")
  72. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  73. tagHumanoid(humanoid, vPlayer)
  74. humanoid:TakeDamage(damage)
  75. wait(1)
  76. untagHumanoid(humanoid)
  77. end
  78. end
  79.  
  80.  
  81. end
  82. end
  83.  
  84.  
  85. function tagHumanoid(humanoid, player)
  86. local creator_tag = Instance.new("ObjectValue")
  87. creator_tag.Value = player
  88. creator_tag.Name = "creator"
  89. creator_tag.Parent = humanoid
  90. end
  91.  
  92. function untagHumanoid(humanoid)
  93. if humanoid ~= nil then
  94. local tag = humanoid:findFirstChild("creator")
  95. if tag ~= nil then
  96. tag.Parent = nil
  97. end
  98. end
  99. end
  100.  
  101.  
  102. function attack()
  103. damage = slash_damage
  104. SlashSound:play()
  105. local anim = Instance.new("StringValue")
  106. anim.Name = "toolanim"
  107. anim.Value = "Slash"
  108. anim.Parent = Tool
  109. end
  110.  
  111.  
  112. function swordUp()
  113. Tool.GripForward = Vector3.new(-1,0,0)
  114. Tool.GripRight = Vector3.new(0,1,0)
  115. Tool.GripUp = Vector3.new(0,0,1)
  116. end
  117.  
  118. function swordOut()
  119. Tool.GripForward = Vector3.new(0,0,1)
  120. Tool.GripRight = Vector3.new(0,-1,0)
  121. Tool.GripUp = Vector3.new(-1,0,0)
  122. end
  123.  
  124.  
  125.  
  126. Tool.Enabled = true
  127.  
  128. function onActivated()
  129.  
  130. if not Tool.Enabled then
  131. return
  132. end
  133.  
  134. Tool.Enabled = false
  135.  
  136. local character = Tool.Parent;
  137. local humanoid = character.Humanoid
  138. if humanoid == nil then
  139. print("Humanoid not found")
  140. return
  141. end
  142.  
  143.  
  144.  
  145. attack()
  146.  
  147. wait(.4)
  148.  
  149. Tool.Enabled = true
  150. end
  151.  
  152.  
  153. function onEquipped()
  154. UnsheathSound:play()
  155. end
  156.  
  157. bh.Activated:connect(onActivated)
  158. bh.Equipped:connect(onEquipped)
  159.  
  160.  
  161. connection = sword.Touched:connect(blow)
Add Comment
Please, Sign In to add comment