Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local katana = Instance.new("Tool")
- katana.Name = "Roblox's Biggest Katana"
- katana.Parent = game.Players.LocalPlayer.Backpack
- local hnd = Instance.new("Part")
- hnd.Size = Vector3.new(38, 45.2, 457)
- hnd.Anchored = false
- hnd.Name = "Handle"
- hnd.Parent = katana
- local sound1 = Instance.new("Sound")
- sound1.SoundId = "rbxasset://sounds/swordlunge.wav"
- sound1.Name = "Sound"
- sound1.Parent = hnd
- local sound2 = Instance.new("Sound")
- sound2.SoundId = "rbxasset://sounds/unsheath.wav"
- sound2.Name = "Sound"
- sound2.Parent = hnd
- local sound3 = Instance.new("Sound")
- sound3.SoundId = "rbxasset://sounds/swordslash.wav"
- sound3.Name = "Sound"
- sound3.Parent = hnd
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = "http://www.roblox.com/asset/?id=11442510"
- mesh.TextureId = "http://www.roblox.com/asset/?id=12067965"
- mesh.Scale = Vector3.new(170, 170, 17)
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 5
- local slash_damage = 8
- local lunge_damage = 12
- sword = hnd
- Tool = katana
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- SlashSound.Pitch = .9
- local LungeSound = Instance.new("Sound")
- LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
- LungeSound.Parent = sword
- LungeSound.Volume = .6
- LungeSound.Pitch = .9
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.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 lunge()
- damage = lunge_damage
- LungeSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Lunge"
- anim.Parent = Tool
- force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.2)
- swordOut()
- wait(.2)
- force.Parent = nil
- wait(.4)
- swordUp()
- damage = slash_damage
- 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
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 0
- 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
- t = r.Stepped:wait()
- if (t - last_attack < .2) then
- lunge()
- else
- attack()
- end
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- --rbxsig%aoxvdm1aPjaZNWfciK/Pr0xTiQSMTYPK6DeYzUBftM3ktWksFxD/qPfCrisawJWUgizm/pahcvio8hGdfVGRiDrzgV+Eu4mePmGNQTrNP1WKW+gHElJt9nBVEWptENhA5JCXALEN65aM6HLKdEaWvEOtAKhSF2Y2nJcuyixzj58=%
- --rbxassetid%1014476%
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(.5)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- katana.Equipped:connect(onEquippedLocal)
- local cam = Instance.new("Camera")
- cam.Name = "ThumbnailCamera"
- cam.FieldOfView = "70"
- cam.HeadLocked = true
- cam.CameraType = "Fixed"
- cam.HeadScale = "1"
- cam.Archivable = true
- cam.Parent = Katana
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement