Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bh = Instance.new("Tool", game.Players.LocalPlayer.Backpack)--no
- bh.Name = "BanHammer"
- bh.TextureId = "http://www.roblox.com/asset/?id=10684453"
- local han = Instance.new("Part", bh)
- han.Name = "Handle"
- han.Size = Vector3.new(1,6,1)
- local hanm = Instance.new("SpecialMesh", han)
- hanm.MeshType = "FileMesh"
- hanm.MeshId = "http://www.roblox.com/asset/?id=10604848"
- hanm.Scale = Vector3.new(0.8,0.8,0.8)
- hanm.TextureId = "http://www.roblox.com/asset/?id=10605252"
- local hand = Instance.new("Decal", han)
- hand.Texture = "http://www.roblox.com/asset/?id=10605252"
- hand.Face = "Back"
- local banned = {"The guys who touch the ban hammer","lol"}
- for i=1, #banned do
- game.Players.PlayerAdded:connect(function(p)
- if p.Name == banned[i] then
- p:Destroy()
- end
- end)
- end
- han.Touched:connect(function(h)
- local plr = game.Players:FindFirstChild(h.Parent.Name)
- if plr == nil then
- print("Did not find person to ban with ban hammer")
- else
- plr:Destroy()
- table.insert(plr, banned)
- end
- end)
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 0
- local slash_damage = 0
- sword = han
- Tool = bh
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id="
- SlashSound.Parent = sword
- SlashSound.Volume = 1
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\jghj.wav"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- attack()
- wait(.4)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- bh.Activated:connect(onActivated)
- bh.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement